From d5c1ae1cb2c11b011e4a0b46da986ed51813eaf7 Mon Sep 17 00:00:00 2001 From: frob Date: Sun, 7 Apr 2024 13:05:39 +0200 Subject: [PATCH 001/136] Update ollama.py for image handling Some clients (eg librechat) send images in datauri format, not plain base64. Strip off the prerix when passing images to ollama. --- litellm/llms/ollama.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/llms/ollama.py b/litellm/llms/ollama.py index 779896abfd..2eb1ce26a6 100644 --- a/litellm/llms/ollama.py +++ b/litellm/llms/ollama.py @@ -157,7 +157,7 @@ def get_ollama_response( if format is not None: data["format"] = format if images is not None: - data["images"] = images + data["images"] = [image.split(",")[-1] if image.startswith("data:") else image for image in images] ## LOGGING logging_obj.pre_call( From 59ed4fb51e89c8e0f18972eb82f0a4da389bcf60 Mon Sep 17 00:00:00 2001 From: frob Date: Mon, 8 Apr 2024 03:28:24 +0200 Subject: [PATCH 002/136] Update ollama.py for image handling ollama wants plain base64 jpeg images, and some clients send dataURI and/or webp. Remove prefixes and convert all non-jpeg images to jpeg. --- litellm/llms/ollama.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/litellm/llms/ollama.py b/litellm/llms/ollama.py index 2eb1ce26a6..65a87e514a 100644 --- a/litellm/llms/ollama.py +++ b/litellm/llms/ollama.py @@ -120,6 +120,31 @@ class OllamaConfig: and v is not None } +# ollama wants plain base64 jpeg files as images. strip any leading dataURI +# and convert to jpeg. +def _convert_image(image): + import base64, io + try: + from PIL import Image + except: + raise Exception( + "ollama image conversion failed please run `pip install Pillow`" + ) + + orig = image + if image.startswith("data:"): + image = image.split(",")[-1] + try: + image_data = Image.open(io.BytesIO(base64.b64decode(image))) + if image_data.format == "JPEG": + return image + except: + return orig + jpeg_image = io.BytesIO() + image_data.convert("RGB").save(jpeg_image, "JPEG") + jpeg_image.seek(0) + return base64.b64encode(jpeg_image.getvalue()).decode("utf-8") + # ollama implementation def get_ollama_response( @@ -157,7 +182,7 @@ def get_ollama_response( if format is not None: data["format"] = format if images is not None: - data["images"] = [image.split(",")[-1] if image.startswith("data:") else image for image in images] + data["images"] = [_convert_image(image) for image in images] ## LOGGING logging_obj.pre_call( From 82a4232dce80e841f59c06cb291d5fe653b9d1ba Mon Sep 17 00:00:00 2001 From: frob Date: Mon, 8 Apr 2024 03:35:02 +0200 Subject: [PATCH 003/136] ollama also accepts PNG --- litellm/llms/ollama.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/llms/ollama.py b/litellm/llms/ollama.py index 65a87e514a..400bf480be 100644 --- a/litellm/llms/ollama.py +++ b/litellm/llms/ollama.py @@ -136,7 +136,7 @@ def _convert_image(image): image = image.split(",")[-1] try: image_data = Image.open(io.BytesIO(base64.b64decode(image))) - if image_data.format == "JPEG": + if image_data.format in ["JPEG", "PNG"]: return image except: return orig From 2492fade3a1373f756d7290165afe6edbb0c65f1 Mon Sep 17 00:00:00 2001 From: frob Date: Tue, 16 Apr 2024 01:12:24 +0200 Subject: [PATCH 004/136] Update comment. --- litellm/llms/ollama.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/llms/ollama.py b/litellm/llms/ollama.py index 860875a46b..670c565904 100644 --- a/litellm/llms/ollama.py +++ b/litellm/llms/ollama.py @@ -120,8 +120,8 @@ class OllamaConfig: and v is not None } -# ollama wants plain base64 jpeg files as images. strip any leading dataURI -# and convert to jpeg. +# ollama wants plain base64 jpeg/png files as images. strip any leading dataURI +# and convert to jpeg if necessary. def _convert_image(image): import base64, io try: From 497f4bb38d83c06488e19bd1465e66c398e2ec29 Mon Sep 17 00:00:00 2001 From: lj Date: Thu, 16 May 2024 16:33:21 +0800 Subject: [PATCH 005/136] Replace root_validator with model_validator --- litellm/proxy/_types.py | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py index d6bf49dca6..42b9b3618f 100644 --- a/litellm/proxy/_types.py +++ b/litellm/proxy/_types.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel, Extra, Field, root_validator, Json, validator +from pydantic import BaseModel, Extra, Field, model_validator, Json, validator from dataclasses import fields import enum from typing import Optional, List, Union, Dict, Literal, Any @@ -240,7 +240,8 @@ class LiteLLMPromptInjectionParams(LiteLLMBase): llm_api_system_prompt: Optional[str] = None llm_api_fail_call_string: Optional[str] = None - @root_validator(pre=True) + @model_validator(mode="before") + @classmethod def check_llm_api_params(cls, values): llm_api_check = values.get("llm_api_check") if llm_api_check is True: @@ -330,7 +331,8 @@ class ModelInfo(LiteLLMBase): extra = Extra.allow # Allow extra fields protected_namespaces = () - @root_validator(pre=True) + @model_validator(mode="before") + @classmethod def set_model_info(cls, values): if values.get("id") is None: values.update({"id": str(uuid.uuid4())}) @@ -359,7 +361,8 @@ class ModelParams(LiteLLMBase): class Config: protected_namespaces = () - @root_validator(pre=True) + @model_validator(mode="before") + @classmethod def set_model_info(cls, values): if values.get("model_info") is None: values.update({"model_info": ModelInfo()}) @@ -406,7 +409,8 @@ class GenerateKeyResponse(GenerateKeyRequest): user_id: Optional[str] = None token_id: Optional[str] = None - @root_validator(pre=True) + @model_validator(mode="before") + @classmethod def set_model_info(cls, values): if values.get("token") is not None: values.update({"key": values.get("token")}) @@ -475,7 +479,8 @@ class UpdateUserRequest(GenerateRequestBase): user_role: Optional[str] = None max_budget: Optional[float] = None - @root_validator(pre=True) + @model_validator(mode="before") + @classmethod def check_user_info(cls, values): if values.get("user_id") is None and values.get("user_email") is None: raise ValueError("Either user id or user email must be provided") @@ -495,7 +500,8 @@ class NewEndUserRequest(LiteLLMBase): None # if no equivalent model in allowed region - default all requests to this model ) - @root_validator(pre=True) + @model_validator(mode="before") + @classmethod def check_user_info(cls, values): if values.get("max_budget") is not None and values.get("budget_id") is not None: raise ValueError("Set either 'max_budget' or 'budget_id', not both.") @@ -508,7 +514,8 @@ class Member(LiteLLMBase): user_id: Optional[str] = None user_email: Optional[str] = None - @root_validator(pre=True) + @model_validator(mode="before") + @classmethod def check_user_info(cls, values): if values.get("user_id") is None and values.get("user_email") is None: raise ValueError("Either user id or user email must be provided") @@ -553,7 +560,8 @@ class TeamMemberDeleteRequest(LiteLLMBase): user_id: Optional[str] = None user_email: Optional[str] = None - @root_validator(pre=True) + @model_validator(mode="before") + @classmethod def check_user_info(cls, values): if values.get("user_id") is None and values.get("user_email") is None: raise ValueError("Either user id or user email must be provided") @@ -590,7 +598,8 @@ class LiteLLM_TeamTable(TeamBase): class Config: protected_namespaces = () - @root_validator(pre=True) + @model_validator(mode="before") + @classmethod def set_model_info(cls, values): dict_fields = [ "metadata", @@ -908,7 +917,8 @@ class UserAPIKeyAuth( user_role: Optional[Literal["proxy_admin", "app_owner", "app_user"]] = None allowed_model_region: Optional[Literal["eu"]] = None - @root_validator(pre=True) + @model_validator(mode="before") + @classmethod def check_api_key(cls, values): if values.get("api_key") is not None: values.update({"token": hash_token(values.get("api_key"))}) @@ -935,7 +945,8 @@ class LiteLLM_UserTable(LiteLLMBase): tpm_limit: Optional[int] = None rpm_limit: Optional[int] = None - @root_validator(pre=True) + @model_validator(mode="before") + @classmethod def set_model_info(cls, values): if values.get("spend") is None: values.update({"spend": 0.0}) @@ -956,7 +967,8 @@ class LiteLLM_EndUserTable(LiteLLMBase): default_model: Optional[str] = None litellm_budget_table: Optional[LiteLLM_BudgetTable] = None - @root_validator(pre=True) + @model_validator(mode="before") + @classmethod def set_model_info(cls, values): if values.get("spend") is None: values.update({"spend": 0.0}) From 6a60bfbd972ff52951af8b8d44414894f53ee69c Mon Sep 17 00:00:00 2001 From: lj Date: Thu, 16 May 2024 16:39:37 +0800 Subject: [PATCH 006/136] Update model config in utils.py --- litellm/utils.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/litellm/utils.py b/litellm/utils.py index 36f4ad481f..cac3ac8655 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -19,7 +19,7 @@ from functools import wraps, lru_cache import datetime, time import tiktoken import uuid -from pydantic import BaseModel +from pydantic import BaseModel, ConfigDict import aiohttp import textwrap import logging @@ -332,9 +332,7 @@ class HiddenParams(OpenAIObject): model_id: Optional[str] = None # used in Router for individual deployments api_base: Optional[str] = None # returns api base used for making completion call - class Config: - extra = "allow" - protected_namespaces = () + model_config: ConfigDict = ConfigDict(extra="allow", protected_namespaces=()) def get(self, key, default=None): # Custom .get() method to access attributes with a default value if the attribute doesn't exist From 665b224226333e2c9ccffb0b1866f2931de03367 Mon Sep 17 00:00:00 2001 From: lj Date: Thu, 16 May 2024 16:42:41 +0800 Subject: [PATCH 007/136] Update model config in _types.py --- litellm/proxy/_types.py | 45 ++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py index 42b9b3618f..84b0a5833b 100644 --- a/litellm/proxy/_types.py +++ b/litellm/proxy/_types.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel, Extra, Field, model_validator, Json, validator +from pydantic import BaseModel, Extra, Field, model_validator, Json, ConfigDict from dataclasses import fields import enum from typing import Optional, List, Union, Dict, Literal, Any @@ -35,8 +35,7 @@ class LiteLLMBase(BaseModel): # if using pydantic v1 return self.__fields_set__ - class Config: - protected_namespaces = () + model_config: ConfigDict = ConfigDict(protected_namespaces=()) class LiteLLM_UpperboundKeyGenerateParams(LiteLLMBase): @@ -299,8 +298,7 @@ class ProxyChatCompletionRequest(LiteLLMBase): deployment_id: Optional[str] = None request_timeout: Optional[int] = None - class Config: - extra = "allow" # allow params not defined here, these fall in litellm.completion(**kwargs) + model_config: ConfigDict = ConfigDict(extra="allow") # allow params not defined here, these fall in litellm.completion(**kwargs) class ModelInfoDelete(LiteLLMBase): @@ -327,9 +325,7 @@ class ModelInfo(LiteLLMBase): ] ] - class Config: - extra = Extra.allow # Allow extra fields - protected_namespaces = () + model_config: ConfigDict = ConfigDict(protected_namespaces=(), extra="allow") @model_validator(mode="before") @classmethod @@ -358,8 +354,7 @@ class ModelParams(LiteLLMBase): litellm_params: dict model_info: ModelInfo - class Config: - protected_namespaces = () + model_config: ConfigDict = ConfigDict(protected_namespaces=()) @model_validator(mode="before") @classmethod @@ -398,8 +393,7 @@ class GenerateKeyRequest(GenerateRequestBase): {} ) # {"gpt-4": 5.0, "gpt-3.5-turbo": 5.0}, defaults to {} - class Config: - protected_namespaces = () + model_config: ConfigDict = ConfigDict(protected_namespaces=()) class GenerateKeyResponse(GenerateKeyRequest): @@ -450,8 +444,7 @@ class LiteLLM_ModelTable(LiteLLMBase): created_by: str updated_by: str - class Config: - protected_namespaces = () + model_config: ConfigDict = ConfigDict(protected_namespaces=()) class NewUserRequest(GenerateKeyRequest): @@ -540,8 +533,7 @@ class TeamBase(LiteLLMBase): class NewTeamRequest(TeamBase): model_aliases: Optional[dict] = None - class Config: - protected_namespaces = () + model_config: ConfigDict = ConfigDict(protected_namespaces=()) class GlobalEndUsersSpend(LiteLLMBase): @@ -595,8 +587,7 @@ class LiteLLM_TeamTable(TeamBase): budget_reset_at: Optional[datetime] = None model_id: Optional[int] = None - class Config: - protected_namespaces = () + model_config: ConfigDict = ConfigDict(protected_namespaces=()) @model_validator(mode="before") @classmethod @@ -635,8 +626,7 @@ class LiteLLM_BudgetTable(LiteLLMBase): model_max_budget: Optional[dict] = None budget_duration: Optional[str] = None - class Config: - protected_namespaces = () + model_config: ConfigDict = ConfigDict(protected_namespaces=()) class NewOrganizationRequest(LiteLLM_BudgetTable): @@ -686,8 +676,7 @@ class KeyManagementSettings(LiteLLMBase): class TeamDefaultSettings(LiteLLMBase): team_id: str - class Config: - extra = "allow" # allow params not defined here, these fall in litellm.completion(**kwargs) + model_config: ConfigDict = ConfigDict(extra="allow") # allow params not defined here, these fall in litellm.completion(**kwargs) class DynamoDBArgs(LiteLLMBase): @@ -851,8 +840,7 @@ class ConfigYAML(LiteLLMBase): description="litellm router object settings. See router.py __init__ for all, example router.num_retries=5, router.timeout=5, router.max_retries=5, router.retry_after=5", ) - class Config: - protected_namespaces = () + model_config: ConfigDict = ConfigDict(protected_namespaces=()) class LiteLLM_VerificationToken(LiteLLMBase): @@ -886,8 +874,7 @@ class LiteLLM_VerificationToken(LiteLLMBase): user_id_rate_limits: Optional[dict] = None team_id_rate_limits: Optional[dict] = None - class Config: - protected_namespaces = () + model_config: ConfigDict = ConfigDict(protected_namespaces=()) class LiteLLM_VerificationTokenView(LiteLLM_VerificationToken): @@ -954,8 +941,7 @@ class LiteLLM_UserTable(LiteLLMBase): values.update({"models": []}) return values - class Config: - protected_namespaces = () + model_config: ConfigDict = ConfigDict(protected_namespaces=()) class LiteLLM_EndUserTable(LiteLLMBase): @@ -974,8 +960,7 @@ class LiteLLM_EndUserTable(LiteLLMBase): values.update({"spend": 0.0}) return values - class Config: - protected_namespaces = () + model_config: ConfigDict = ConfigDict(protected_namespaces=()) class LiteLLM_SpendLogs(LiteLLMBase): From 603705661a6590d100516e8e741c256a2a7b0082 Mon Sep 17 00:00:00 2001 From: lj Date: Thu, 16 May 2024 16:51:36 +0800 Subject: [PATCH 008/136] Update model config in test_config.py --- litellm/tests/test_config.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/litellm/tests/test_config.py b/litellm/tests/test_config.py index e38187e0ea..cb7a9f484d 100644 --- a/litellm/tests/test_config.py +++ b/litellm/tests/test_config.py @@ -13,7 +13,7 @@ sys.path.insert( 0, os.path.abspath("../..") ) # Adds the parent directory to the, system path import pytest, litellm -from pydantic import BaseModel +from pydantic import BaseModel, ConfigDict from litellm.proxy.proxy_server import ProxyConfig from litellm.proxy.utils import encrypt_value, ProxyLogging, DualCache from litellm.types.router import Deployment, LiteLLM_Params, ModelInfo @@ -26,8 +26,7 @@ class DBModel(BaseModel): model_info: dict litellm_params: dict - class Config: - protected_namespaces = () + config_dict: ConfigDict = ConfigDict(protected_namespaces=()) @pytest.mark.asyncio From 64f40385203934e0238560d56b3394ebad6b60ff Mon Sep 17 00:00:00 2001 From: lj Date: Thu, 16 May 2024 16:52:21 +0800 Subject: [PATCH 009/136] Update model config in completion.py --- litellm/types/completion.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/litellm/types/completion.py b/litellm/types/completion.py index 78af7667ba..36d6cf994c 100644 --- a/litellm/types/completion.py +++ b/litellm/types/completion.py @@ -1,6 +1,6 @@ from typing import List, Optional, Union, Iterable -from pydantic import BaseModel, validator +from pydantic import BaseModel, ConfigDict, validator from typing_extensions import Literal, Required, TypedDict @@ -191,6 +191,4 @@ class CompletionRequest(BaseModel): api_key: Optional[str] = None model_list: Optional[List[str]] = None - class Config: - extra = "allow" - protected_namespaces = () + model_config: ConfigDict = ConfigDict(protected_namespaces=(), extra="allow") From 5945bb5ed28d0da04b3f7e7f8114cdcaddba481b Mon Sep 17 00:00:00 2001 From: lj Date: Thu, 16 May 2024 16:52:44 +0800 Subject: [PATCH 010/136] Update model config in embedding.py --- litellm/types/embedding.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/litellm/types/embedding.py b/litellm/types/embedding.py index 9db0ef2907..c0af79b996 100644 --- a/litellm/types/embedding.py +++ b/litellm/types/embedding.py @@ -1,6 +1,6 @@ from typing import List, Optional, Union -from pydantic import BaseModel, validator +from pydantic import BaseModel, ConfigDict class EmbeddingRequest(BaseModel): @@ -18,6 +18,4 @@ class EmbeddingRequest(BaseModel): litellm_logging_obj: Optional[dict] = None logger_fn: Optional[str] = None - class Config: - # allow kwargs - extra = "allow" + model_config: ConfigDict = ConfigDict(extra="allow") From 7c31eccdc23719503bbda28f7a4f0fc0f5429c6e Mon Sep 17 00:00:00 2001 From: lj Date: Thu, 16 May 2024 16:53:05 +0800 Subject: [PATCH 011/136] Update model config in router.py --- litellm/types/router.py | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/litellm/types/router.py b/litellm/types/router.py index 68ee387fea..c9c74ac20d 100644 --- a/litellm/types/router.py +++ b/litellm/types/router.py @@ -1,6 +1,6 @@ from typing import List, Optional, Union, Dict, Tuple, Literal, TypedDict import httpx -from pydantic import BaseModel, validator, Field +from pydantic import BaseModel, ConfigDict, validator, Field from .completion import CompletionRequest from .embedding import EmbeddingRequest import uuid, enum @@ -12,8 +12,7 @@ class ModelConfig(BaseModel): tpm: int rpm: int - class Config: - protected_namespaces = () + model_config: ConfigDict = ConfigDict(protected_namespaces=()) class RouterConfig(BaseModel): @@ -44,8 +43,7 @@ class RouterConfig(BaseModel): "latency-based-routing", ] = "simple-shuffle" - class Config: - protected_namespaces = () + model_config: ConfigDict = ConfigDict(protected_namespaces=()) class UpdateRouterConfig(BaseModel): @@ -65,8 +63,7 @@ class UpdateRouterConfig(BaseModel): fallbacks: Optional[List[dict]] = None context_window_fallbacks: Optional[List[dict]] = None - class Config: - protected_namespaces = () + model_config: ConfigDict = ConfigDict(protected_namespaces=()) class ModelInfo(BaseModel): @@ -84,8 +81,7 @@ class ModelInfo(BaseModel): id = str(id) super().__init__(id=id, **params) - class Config: - extra = "allow" + model_config: ConfigDict = ConfigDict(extra="allow") def __contains__(self, key): # Define custom behavior for the 'in' operator @@ -139,6 +135,8 @@ class GenericLiteLLMParams(BaseModel): output_cost_per_token: Optional[float] = None input_cost_per_second: Optional[float] = None output_cost_per_second: Optional[float] = None + + model_config: ConfigDict = ConfigDict(extra="allow", arbitrary_types_allowed=True) def __init__( self, @@ -180,10 +178,6 @@ class GenericLiteLLMParams(BaseModel): max_retries = int(max_retries) # cast to int super().__init__(max_retries=max_retries, **args, **params) - class Config: - extra = "allow" - arbitrary_types_allowed = True - def __contains__(self, key): # Define custom behavior for the 'in' operator return hasattr(self, key) @@ -207,6 +201,7 @@ class LiteLLM_Params(GenericLiteLLMParams): """ model: str + model_config: ConfigDict = ConfigDict(extra="allow", arbitrary_types_allowed=True) def __init__( self, @@ -241,9 +236,6 @@ class LiteLLM_Params(GenericLiteLLMParams): max_retries = int(max_retries) # cast to int super().__init__(max_retries=max_retries, **args, **params) - class Config: - extra = "allow" - arbitrary_types_allowed = True def __contains__(self, key): # Define custom behavior for the 'in' operator @@ -273,8 +265,7 @@ class updateDeployment(BaseModel): litellm_params: Optional[updateLiteLLMParams] = None model_info: Optional[ModelInfo] = None - class Config: - protected_namespaces = () + model_config: ConfigDict = ConfigDict(protected_namespaces=()) class LiteLLMParamsTypedDict(TypedDict, total=False): @@ -322,6 +313,8 @@ class Deployment(BaseModel): model_name: str litellm_params: LiteLLM_Params model_info: ModelInfo + + model_config: ConfigDict = ConfigDict(extra="allow", protected_namespaces=()) def __init__( self, @@ -348,9 +341,6 @@ class Deployment(BaseModel): # if using pydantic v1 return self.dict(**kwargs) - class Config: - extra = "allow" - protected_namespaces = () def __contains__(self, key): # Define custom behavior for the 'in' operator From f3d0f003fb4319ae12c79fdb1297144707c5e66b Mon Sep 17 00:00:00 2001 From: lj Date: Fri, 17 May 2024 10:39:00 +0800 Subject: [PATCH 012/136] Removed config dict type definition --- litellm/proxy/_types.py | 28 ++++++++++++++-------------- litellm/types/completion.py | 2 +- litellm/types/embedding.py | 2 +- litellm/types/router.py | 16 ++++++++-------- litellm/utils.py | 2 +- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py index 84b0a5833b..11bd2e77c7 100644 --- a/litellm/proxy/_types.py +++ b/litellm/proxy/_types.py @@ -35,7 +35,7 @@ class LiteLLMBase(BaseModel): # if using pydantic v1 return self.__fields_set__ - model_config: ConfigDict = ConfigDict(protected_namespaces=()) + model_config = ConfigDict(protected_namespaces=()) class LiteLLM_UpperboundKeyGenerateParams(LiteLLMBase): @@ -298,7 +298,7 @@ class ProxyChatCompletionRequest(LiteLLMBase): deployment_id: Optional[str] = None request_timeout: Optional[int] = None - model_config: ConfigDict = ConfigDict(extra="allow") # allow params not defined here, these fall in litellm.completion(**kwargs) + model_config = ConfigDict(extra="allow") # allow params not defined here, these fall in litellm.completion(**kwargs) class ModelInfoDelete(LiteLLMBase): @@ -325,7 +325,7 @@ class ModelInfo(LiteLLMBase): ] ] - model_config: ConfigDict = ConfigDict(protected_namespaces=(), extra="allow") + model_config = ConfigDict(protected_namespaces=(), extra="allow") @model_validator(mode="before") @classmethod @@ -354,7 +354,7 @@ class ModelParams(LiteLLMBase): litellm_params: dict model_info: ModelInfo - model_config: ConfigDict = ConfigDict(protected_namespaces=()) + model_config = ConfigDict(protected_namespaces=()) @model_validator(mode="before") @classmethod @@ -393,7 +393,7 @@ class GenerateKeyRequest(GenerateRequestBase): {} ) # {"gpt-4": 5.0, "gpt-3.5-turbo": 5.0}, defaults to {} - model_config: ConfigDict = ConfigDict(protected_namespaces=()) + model_config = ConfigDict(protected_namespaces=()) class GenerateKeyResponse(GenerateKeyRequest): @@ -444,7 +444,7 @@ class LiteLLM_ModelTable(LiteLLMBase): created_by: str updated_by: str - model_config: ConfigDict = ConfigDict(protected_namespaces=()) + model_config = ConfigDict(protected_namespaces=()) class NewUserRequest(GenerateKeyRequest): @@ -533,7 +533,7 @@ class TeamBase(LiteLLMBase): class NewTeamRequest(TeamBase): model_aliases: Optional[dict] = None - model_config: ConfigDict = ConfigDict(protected_namespaces=()) + model_config = ConfigDict(protected_namespaces=()) class GlobalEndUsersSpend(LiteLLMBase): @@ -587,7 +587,7 @@ class LiteLLM_TeamTable(TeamBase): budget_reset_at: Optional[datetime] = None model_id: Optional[int] = None - model_config: ConfigDict = ConfigDict(protected_namespaces=()) + model_config = ConfigDict(protected_namespaces=()) @model_validator(mode="before") @classmethod @@ -626,7 +626,7 @@ class LiteLLM_BudgetTable(LiteLLMBase): model_max_budget: Optional[dict] = None budget_duration: Optional[str] = None - model_config: ConfigDict = ConfigDict(protected_namespaces=()) + model_config = ConfigDict(protected_namespaces=()) class NewOrganizationRequest(LiteLLM_BudgetTable): @@ -676,7 +676,7 @@ class KeyManagementSettings(LiteLLMBase): class TeamDefaultSettings(LiteLLMBase): team_id: str - model_config: ConfigDict = ConfigDict(extra="allow") # allow params not defined here, these fall in litellm.completion(**kwargs) + model_config = ConfigDict(extra="allow") # allow params not defined here, these fall in litellm.completion(**kwargs) class DynamoDBArgs(LiteLLMBase): @@ -840,7 +840,7 @@ class ConfigYAML(LiteLLMBase): description="litellm router object settings. See router.py __init__ for all, example router.num_retries=5, router.timeout=5, router.max_retries=5, router.retry_after=5", ) - model_config: ConfigDict = ConfigDict(protected_namespaces=()) + model_config = ConfigDict(protected_namespaces=()) class LiteLLM_VerificationToken(LiteLLMBase): @@ -874,7 +874,7 @@ class LiteLLM_VerificationToken(LiteLLMBase): user_id_rate_limits: Optional[dict] = None team_id_rate_limits: Optional[dict] = None - model_config: ConfigDict = ConfigDict(protected_namespaces=()) + model_config = ConfigDict(protected_namespaces=()) class LiteLLM_VerificationTokenView(LiteLLM_VerificationToken): @@ -941,7 +941,7 @@ class LiteLLM_UserTable(LiteLLMBase): values.update({"models": []}) return values - model_config: ConfigDict = ConfigDict(protected_namespaces=()) + model_config = ConfigDict(protected_namespaces=()) class LiteLLM_EndUserTable(LiteLLMBase): @@ -960,7 +960,7 @@ class LiteLLM_EndUserTable(LiteLLMBase): values.update({"spend": 0.0}) return values - model_config: ConfigDict = ConfigDict(protected_namespaces=()) + model_config = ConfigDict(protected_namespaces=()) class LiteLLM_SpendLogs(LiteLLMBase): diff --git a/litellm/types/completion.py b/litellm/types/completion.py index 36d6cf994c..c8ddc74498 100644 --- a/litellm/types/completion.py +++ b/litellm/types/completion.py @@ -191,4 +191,4 @@ class CompletionRequest(BaseModel): api_key: Optional[str] = None model_list: Optional[List[str]] = None - model_config: ConfigDict = ConfigDict(protected_namespaces=(), extra="allow") + model_config = ConfigDict(protected_namespaces=(), extra="allow") diff --git a/litellm/types/embedding.py b/litellm/types/embedding.py index c0af79b996..f8fdebc539 100644 --- a/litellm/types/embedding.py +++ b/litellm/types/embedding.py @@ -18,4 +18,4 @@ class EmbeddingRequest(BaseModel): litellm_logging_obj: Optional[dict] = None logger_fn: Optional[str] = None - model_config: ConfigDict = ConfigDict(extra="allow") + model_config = ConfigDict(extra="allow") diff --git a/litellm/types/router.py b/litellm/types/router.py index c9c74ac20d..189988a615 100644 --- a/litellm/types/router.py +++ b/litellm/types/router.py @@ -12,7 +12,7 @@ class ModelConfig(BaseModel): tpm: int rpm: int - model_config: ConfigDict = ConfigDict(protected_namespaces=()) + model_config = ConfigDict(protected_namespaces=()) class RouterConfig(BaseModel): @@ -43,7 +43,7 @@ class RouterConfig(BaseModel): "latency-based-routing", ] = "simple-shuffle" - model_config: ConfigDict = ConfigDict(protected_namespaces=()) + model_config = ConfigDict(protected_namespaces=()) class UpdateRouterConfig(BaseModel): @@ -63,7 +63,7 @@ class UpdateRouterConfig(BaseModel): fallbacks: Optional[List[dict]] = None context_window_fallbacks: Optional[List[dict]] = None - model_config: ConfigDict = ConfigDict(protected_namespaces=()) + model_config = ConfigDict(protected_namespaces=()) class ModelInfo(BaseModel): @@ -81,7 +81,7 @@ class ModelInfo(BaseModel): id = str(id) super().__init__(id=id, **params) - model_config: ConfigDict = ConfigDict(extra="allow") + model_config = ConfigDict(extra="allow") def __contains__(self, key): # Define custom behavior for the 'in' operator @@ -136,7 +136,7 @@ class GenericLiteLLMParams(BaseModel): input_cost_per_second: Optional[float] = None output_cost_per_second: Optional[float] = None - model_config: ConfigDict = ConfigDict(extra="allow", arbitrary_types_allowed=True) + model_config = ConfigDict(extra="allow", arbitrary_types_allowed=True) def __init__( self, @@ -201,7 +201,7 @@ class LiteLLM_Params(GenericLiteLLMParams): """ model: str - model_config: ConfigDict = ConfigDict(extra="allow", arbitrary_types_allowed=True) + model_config = ConfigDict(extra="allow", arbitrary_types_allowed=True) def __init__( self, @@ -265,7 +265,7 @@ class updateDeployment(BaseModel): litellm_params: Optional[updateLiteLLMParams] = None model_info: Optional[ModelInfo] = None - model_config: ConfigDict = ConfigDict(protected_namespaces=()) + model_config = ConfigDict(protected_namespaces=()) class LiteLLMParamsTypedDict(TypedDict, total=False): @@ -314,7 +314,7 @@ class Deployment(BaseModel): litellm_params: LiteLLM_Params model_info: ModelInfo - model_config: ConfigDict = ConfigDict(extra="allow", protected_namespaces=()) + model_config = ConfigDict(extra="allow", protected_namespaces=()) def __init__( self, diff --git a/litellm/utils.py b/litellm/utils.py index cac3ac8655..53a2d31ce4 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -332,7 +332,7 @@ class HiddenParams(OpenAIObject): model_id: Optional[str] = None # used in Router for individual deployments api_base: Optional[str] = None # returns api base used for making completion call - model_config: ConfigDict = ConfigDict(extra="allow", protected_namespaces=()) + model_config = ConfigDict(extra="allow", protected_namespaces=()) def get(self, key, default=None): # Custom .get() method to access attributes with a default value if the attribute doesn't exist From 1de5aa30af38bc6d89d55602109e3879fea567f0 Mon Sep 17 00:00:00 2001 From: lj Date: Fri, 17 May 2024 10:39:36 +0800 Subject: [PATCH 013/136] Add pydantic plugin to mypy to eliminate incorrect lint errors --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 55e88c30a2..e38958ea10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,3 +84,5 @@ version_files = [ "pyproject.toml:^version" ] +[tool.mypy] +plugins = "pydantic.mypy" From 7602c6f436815aa457d9fdc353284541ec1c8d25 Mon Sep 17 00:00:00 2001 From: Nir Gazit Date: Sun, 26 May 2024 10:08:48 +0300 Subject: [PATCH 014/136] Revert "Revert "Log errors in Traceloop Integration"" --- litellm/integrations/traceloop.py | 229 +++++++++++++++++------------- litellm/tests/test_traceloop.py | 74 ++++------ litellm/utils.py | 12 ++ 3 files changed, 176 insertions(+), 139 deletions(-) diff --git a/litellm/integrations/traceloop.py b/litellm/integrations/traceloop.py index bbdb9a1b0a..39d62028e8 100644 --- a/litellm/integrations/traceloop.py +++ b/litellm/integrations/traceloop.py @@ -1,114 +1,153 @@ +import traceback +from litellm._logging import verbose_logger +import litellm + + class TraceloopLogger: def __init__(self): - from traceloop.sdk.tracing.tracing import TracerWrapper - from traceloop.sdk import Traceloop + try: + from traceloop.sdk.tracing.tracing import TracerWrapper + from traceloop.sdk import Traceloop + from traceloop.sdk.instruments import Instruments + except ModuleNotFoundError as e: + verbose_logger.error( + f"Traceloop not installed, try running 'pip install traceloop-sdk' to fix this error: {e}\n{traceback.format_exc()}" + ) - Traceloop.init(app_name="Litellm-Server", disable_batch=True) + Traceloop.init( + app_name="Litellm-Server", + disable_batch=True, + instruments=[ + Instruments.CHROMA, + Instruments.PINECONE, + Instruments.WEAVIATE, + Instruments.LLAMA_INDEX, + Instruments.LANGCHAIN, + ], + ) self.tracer_wrapper = TracerWrapper() - def log_event(self, kwargs, response_obj, start_time, end_time, print_verbose): - from opentelemetry.trace import SpanKind + def log_event( + self, + kwargs, + response_obj, + start_time, + end_time, + user_id, + print_verbose, + level="DEFAULT", + status_message=None, + ): + from opentelemetry import trace + from opentelemetry.trace import SpanKind, Status, StatusCode from opentelemetry.semconv.ai import SpanAttributes try: + print_verbose( + f"Traceloop Logging - Enters logging function for model {kwargs}" + ) + tracer = self.tracer_wrapper.get_tracer() - model = kwargs.get("model") - - # LiteLLM uses the standard OpenAI library, so it's already handled by Traceloop SDK - if kwargs.get("litellm_params").get("custom_llm_provider") == "openai": - return - optional_params = kwargs.get("optional_params", {}) - with tracer.start_as_current_span( - "litellm.completion", - kind=SpanKind.CLIENT, - ) as span: - if span.is_recording(): + span = tracer.start_span( + "litellm.completion", kind=SpanKind.CLIENT, start_time=start_time + ) + + if span.is_recording(): + span.set_attribute( + SpanAttributes.LLM_REQUEST_MODEL, kwargs.get("model") + ) + if "stop" in optional_params: span.set_attribute( - SpanAttributes.LLM_REQUEST_MODEL, kwargs.get("model") + SpanAttributes.LLM_CHAT_STOP_SEQUENCES, + optional_params.get("stop"), ) - if "stop" in optional_params: - span.set_attribute( - SpanAttributes.LLM_CHAT_STOP_SEQUENCES, - optional_params.get("stop"), - ) - if "frequency_penalty" in optional_params: - span.set_attribute( - SpanAttributes.LLM_FREQUENCY_PENALTY, - optional_params.get("frequency_penalty"), - ) - if "presence_penalty" in optional_params: - span.set_attribute( - SpanAttributes.LLM_PRESENCE_PENALTY, - optional_params.get("presence_penalty"), - ) - if "top_p" in optional_params: - span.set_attribute( - SpanAttributes.LLM_TOP_P, optional_params.get("top_p") - ) - if "tools" in optional_params or "functions" in optional_params: - span.set_attribute( - SpanAttributes.LLM_REQUEST_FUNCTIONS, - optional_params.get( - "tools", optional_params.get("functions") - ), - ) - if "user" in optional_params: - span.set_attribute( - SpanAttributes.LLM_USER, optional_params.get("user") - ) - if "max_tokens" in optional_params: - span.set_attribute( - SpanAttributes.LLM_REQUEST_MAX_TOKENS, - kwargs.get("max_tokens"), - ) - if "temperature" in optional_params: - span.set_attribute( - SpanAttributes.LLM_TEMPERATURE, kwargs.get("temperature") - ) - - for idx, prompt in enumerate(kwargs.get("messages")): - span.set_attribute( - f"{SpanAttributes.LLM_PROMPTS}.{idx}.role", - prompt.get("role"), - ) - span.set_attribute( - f"{SpanAttributes.LLM_PROMPTS}.{idx}.content", - prompt.get("content"), - ) - + if "frequency_penalty" in optional_params: span.set_attribute( - SpanAttributes.LLM_RESPONSE_MODEL, response_obj.get("model") + SpanAttributes.LLM_FREQUENCY_PENALTY, + optional_params.get("frequency_penalty"), + ) + if "presence_penalty" in optional_params: + span.set_attribute( + SpanAttributes.LLM_PRESENCE_PENALTY, + optional_params.get("presence_penalty"), + ) + if "top_p" in optional_params: + span.set_attribute( + SpanAttributes.LLM_TOP_P, optional_params.get("top_p") + ) + if "tools" in optional_params or "functions" in optional_params: + span.set_attribute( + SpanAttributes.LLM_REQUEST_FUNCTIONS, + optional_params.get("tools", optional_params.get("functions")), + ) + if "user" in optional_params: + span.set_attribute( + SpanAttributes.LLM_USER, optional_params.get("user") + ) + if "max_tokens" in optional_params: + span.set_attribute( + SpanAttributes.LLM_REQUEST_MAX_TOKENS, + kwargs.get("max_tokens"), + ) + if "temperature" in optional_params: + span.set_attribute( + SpanAttributes.LLM_REQUEST_TEMPERATURE, + kwargs.get("temperature"), ) - usage = response_obj.get("usage") - if usage: - span.set_attribute( - SpanAttributes.LLM_USAGE_TOTAL_TOKENS, - usage.get("total_tokens"), - ) - span.set_attribute( - SpanAttributes.LLM_USAGE_COMPLETION_TOKENS, - usage.get("completion_tokens"), - ) - span.set_attribute( - SpanAttributes.LLM_USAGE_PROMPT_TOKENS, - usage.get("prompt_tokens"), - ) - for idx, choice in enumerate(response_obj.get("choices")): - span.set_attribute( - f"{SpanAttributes.LLM_COMPLETIONS}.{idx}.finish_reason", - choice.get("finish_reason"), - ) - span.set_attribute( - f"{SpanAttributes.LLM_COMPLETIONS}.{idx}.role", - choice.get("message").get("role"), - ) - span.set_attribute( - f"{SpanAttributes.LLM_COMPLETIONS}.{idx}.content", - choice.get("message").get("content"), - ) + for idx, prompt in enumerate(kwargs.get("messages")): + span.set_attribute( + f"{SpanAttributes.LLM_PROMPTS}.{idx}.role", + prompt.get("role"), + ) + span.set_attribute( + f"{SpanAttributes.LLM_PROMPTS}.{idx}.content", + prompt.get("content"), + ) + + span.set_attribute( + SpanAttributes.LLM_RESPONSE_MODEL, response_obj.get("model") + ) + usage = response_obj.get("usage") + if usage: + span.set_attribute( + SpanAttributes.LLM_USAGE_TOTAL_TOKENS, + usage.get("total_tokens"), + ) + span.set_attribute( + SpanAttributes.LLM_USAGE_COMPLETION_TOKENS, + usage.get("completion_tokens"), + ) + span.set_attribute( + SpanAttributes.LLM_USAGE_PROMPT_TOKENS, + usage.get("prompt_tokens"), + ) + + for idx, choice in enumerate(response_obj.get("choices")): + span.set_attribute( + f"{SpanAttributes.LLM_COMPLETIONS}.{idx}.finish_reason", + choice.get("finish_reason"), + ) + span.set_attribute( + f"{SpanAttributes.LLM_COMPLETIONS}.{idx}.role", + choice.get("message").get("role"), + ) + span.set_attribute( + f"{SpanAttributes.LLM_COMPLETIONS}.{idx}.content", + choice.get("message").get("content"), + ) + + if ( + level == "ERROR" + and status_message is not None + and isinstance(status_message, str) + ): + span.record_exception(Exception(status_message)) + span.set_status(Status(StatusCode.ERROR, status_message)) + + span.end(end_time) except Exception as e: print_verbose(f"Traceloop Layer Error - {e}") diff --git a/litellm/tests/test_traceloop.py b/litellm/tests/test_traceloop.py index 405a8a3574..f969736285 100644 --- a/litellm/tests/test_traceloop.py +++ b/litellm/tests/test_traceloop.py @@ -1,49 +1,35 @@ -# Commented out for now - since traceloop break ci/cd -# import sys -# import os -# import io, asyncio +import sys +import os +import time +import pytest +import litellm +from opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter +from traceloop.sdk import Traceloop -# sys.path.insert(0, os.path.abspath('../..')) - -# from litellm import completion -# import litellm -# litellm.num_retries = 3 -# litellm.success_callback = [""] -# import time -# import pytest -# from traceloop.sdk import Traceloop -# Traceloop.init(app_name="test-litellm", disable_batch=True) +sys.path.insert(0, os.path.abspath("../..")) -# def test_traceloop_logging(): -# try: -# litellm.set_verbose = True -# response = litellm.completion( -# model="gpt-3.5-turbo", -# messages=[{"role": "user", "content":"This is a test"}], -# max_tokens=1000, -# temperature=0.7, -# timeout=5, -# ) -# print(f"response: {response}") -# except Exception as e: -# pytest.fail(f"An exception occurred - {e}") -# # test_traceloop_logging() +@pytest.fixture() +def exporter(): + exporter = InMemorySpanExporter() + Traceloop.init( + app_name="test_litellm", + disable_batch=True, + exporter=exporter, + ) + litellm.success_callback = ["traceloop"] + litellm.set_verbose = True + + return exporter -# # def test_traceloop_logging_async(): -# # try: -# # litellm.set_verbose = True -# # async def test_acompletion(): -# # return await litellm.acompletion( -# # model="gpt-3.5-turbo", -# # messages=[{"role": "user", "content":"This is a test"}], -# # max_tokens=1000, -# # temperature=0.7, -# # timeout=5, -# # ) -# # response = asyncio.run(test_acompletion()) -# # print(f"response: {response}") -# # except Exception as e: -# # pytest.fail(f"An exception occurred - {e}") -# # test_traceloop_logging_async() +@pytest.mark.parametrize("model", ["claude-instant-1.2", "gpt-3.5-turbo"]) +def test_traceloop_logging(exporter, model): + + litellm.completion( + model=model, + messages=[{"role": "user", "content": "This is a test"}], + max_tokens=1000, + temperature=0.7, + timeout=5, + ) diff --git a/litellm/utils.py b/litellm/utils.py index 5da01c764f..bef4fb55bf 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -2027,6 +2027,7 @@ class Logging: response_obj=result, start_time=start_time, end_time=end_time, + user_id=kwargs.get("user", None), print_verbose=print_verbose, ) if callback == "s3": @@ -2598,6 +2599,17 @@ class Logging: level="ERROR", kwargs=self.model_call_details, ) + if callback == "traceloop": + traceloopLogger.log_event( + start_time=start_time, + end_time=end_time, + response_obj=None, + user_id=kwargs.get("user", None), + print_verbose=print_verbose, + status_message=str(exception), + level="ERROR", + kwargs=self.model_call_details, + ) if callback == "prometheus": global prometheusLogger verbose_logger.debug("reaches prometheus for success logging!") From 0a50deb6dc926d3b19305e06f682fac4539f62fe Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Mon, 27 May 2024 22:37:12 -0700 Subject: [PATCH 015/136] ui - setup / test email alerting --- .../src/components/settings.tsx | 85 ++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) diff --git a/ui/litellm-dashboard/src/components/settings.tsx b/ui/litellm-dashboard/src/components/settings.tsx index 5f712b1d44..badea63416 100644 --- a/ui/litellm-dashboard/src/components/settings.tsx +++ b/ui/litellm-dashboard/src/components/settings.tsx @@ -188,6 +188,43 @@ const Settings: React.FC = ({ console.log("Selected values:", values); }; + const handleSaveEmailSettings = () => { + if (!accessToken) { + return; + } + + + let updatedVariables: Record = {}; + + alerts + .filter((alert) => alert.name === "email") + .forEach((alert) => { + Object.entries(alert.variables ?? {}).forEach(([key, value]) => { + const inputElement = document.querySelector(`input[name="${key}"]`) as HTMLInputElement; + if (inputElement && inputElement.value) { + updatedVariables[key] = inputElement?.value; + } + }); + }); + + console.log("updatedVariables", updatedVariables); + //filter out null / undefined values for updatedVariables + + const payload = { + general_settings: { + alerting: ["email"], + }, + environment_variables: updatedVariables, + }; + try { + setCallbacksCall(accessToken, payload); + } catch (error) { + message.error("Failed to update alerts: " + error, 20); + } + + message.success("Email settings updated successfully"); + } + const handleSaveAlerts = () => { if (!accessToken) { return; @@ -369,7 +406,8 @@ const Settings: React.FC = ({ Logging Callbacks Alerting Types - Alerting Settings + Alerting Settings + Email Alerts @@ -526,6 +564,51 @@ const Settings: React.FC = ({ premiumUser={premiumUser} /> + + + {/* + Email Alerts are sent to when
+ - A key is created for a specific user_id
+ - A key belonging to a user crosses its budget +
*/} + Setup +
+ {alerts + .filter((alert) => alert.name == "email") + .map((alert, index) => ( + +
    + {Object.entries(alert.variables ?? {}) + + .map(([key, value]) => ( +
  • + {key} + +
  • + ))} +
+
+ ))} + +
+ + + + +
+
From b5f88b67b360db9c5b06acbe63e0a296cbad8e6b Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Mon, 27 May 2024 22:38:17 -0700 Subject: [PATCH 016/136] fix - validation for email alerting --- litellm/integrations/slack_alerting.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/litellm/integrations/slack_alerting.py b/litellm/integrations/slack_alerting.py index c822958d93..8fa1be8915 100644 --- a/litellm/integrations/slack_alerting.py +++ b/litellm/integrations/slack_alerting.py @@ -41,6 +41,7 @@ class ProviderRegionOutageModel(BaseOutageModel): # we use this for the email header, please send a test email if you change this. verify it looks good on email LITELLM_LOGO_URL = "https://litellm-listing.s3.amazonaws.com/litellm_logo.png" +LITELLM_SUPPORT_CONTACT = "support@berri.ai" class LiteLLMBase(BaseModel): @@ -1171,6 +1172,10 @@ Model Info: await self._check_if_using_premium_email_feature( premium_user, email_logo_url, email_support_contact ) + if email_logo_url is None: + email_logo_url = LITELLM_LOGO_URL + if email_support_contact is None: + email_support_contact = LITELLM_SUPPORT_CONTACT event_name = webhook_event.event_message recipient_email = webhook_event.user_email @@ -1271,6 +1276,11 @@ Model Info: premium_user, email_logo_url, email_support_contact ) + if email_logo_url is None: + email_logo_url = LITELLM_LOGO_URL + if email_support_contact is None: + email_support_contact = LITELLM_SUPPORT_CONTACT + event_name = webhook_event.event_message recipient_email = webhook_event.user_email user_name = webhook_event.user_id From 24c80e6bc758333655c7ccfffba6c7db0d0fdb1a Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Mon, 27 May 2024 22:46:45 -0700 Subject: [PATCH 017/136] fix - testing email alerting --- litellm/proxy/proxy_server.py | 164 ++++++++++++++++++++++++---------- 1 file changed, 118 insertions(+), 46 deletions(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 0e8d20f164..c67363456d 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -2930,48 +2930,54 @@ class ProxyConfig: global llm_router, llm_model_list, master_key, general_settings import base64 - if llm_router is None and master_key is not None: - verbose_proxy_logger.debug(f"len new_models: {len(new_models)}") + try: + if llm_router is None and master_key is not None: + verbose_proxy_logger.debug(f"len new_models: {len(new_models)}") - _model_list: list = [] - for m in new_models: - _litellm_params = m.litellm_params - if isinstance(_litellm_params, dict): - # decrypt values - for k, v in _litellm_params.items(): - if isinstance(v, str): - # decode base64 - decoded_b64 = base64.b64decode(v) - # decrypt value - _litellm_params[k] = decrypt_value( - value=decoded_b64, master_key=master_key # type: ignore - ) - _litellm_params = LiteLLM_Params(**_litellm_params) - else: - verbose_proxy_logger.error( - f"Invalid model added to proxy db. Invalid litellm params. litellm_params={_litellm_params}" + _model_list: list = [] + for m in new_models: + _litellm_params = m.litellm_params + if isinstance(_litellm_params, dict): + # decrypt values + for k, v in _litellm_params.items(): + if isinstance(v, str): + # decode base64 + decoded_b64 = base64.b64decode(v) + # decrypt value + _litellm_params[k] = decrypt_value( + value=decoded_b64, master_key=master_key # type: ignore + ) + _litellm_params = LiteLLM_Params(**_litellm_params) + else: + verbose_proxy_logger.error( + f"Invalid model added to proxy db. Invalid litellm params. litellm_params={_litellm_params}" + ) + continue # skip to next model + + _model_info = self.get_model_info_with_id(model=m) + _model_list.append( + Deployment( + model_name=m.model_name, + litellm_params=_litellm_params, + model_info=_model_info, + ).to_json(exclude_none=True) ) - continue # skip to next model + if len(_model_list) > 0: + verbose_proxy_logger.debug(f"_model_list: {_model_list}") + llm_router = litellm.Router(model_list=_model_list) + verbose_proxy_logger.debug(f"updated llm_router: {llm_router}") + else: + verbose_proxy_logger.debug(f"len new_models: {len(new_models)}") + ## DELETE MODEL LOGIC + await self._delete_deployment(db_models=new_models) - _model_info = self.get_model_info_with_id(model=m) - _model_list.append( - Deployment( - model_name=m.model_name, - litellm_params=_litellm_params, - model_info=_model_info, - ).to_json(exclude_none=True) - ) - if len(_model_list) > 0: - verbose_proxy_logger.debug(f"_model_list: {_model_list}") - llm_router = litellm.Router(model_list=_model_list) - verbose_proxy_logger.debug(f"updated llm_router: {llm_router}") - else: - verbose_proxy_logger.debug(f"len new_models: {len(new_models)}") - ## DELETE MODEL LOGIC - await self._delete_deployment(db_models=new_models) + ## ADD MODEL LOGIC + self._add_deployment(db_models=new_models) - ## ADD MODEL LOGIC - self._add_deployment(db_models=new_models) + except Exception as e: + verbose_proxy_logger.error( + f"Error adding/deleting model to llm_router: {str(e)}" + ) if llm_router is not None: llm_model_list = llm_router.get_model_list() @@ -3020,11 +3026,20 @@ class ProxyConfig: ## ALERTING ## [TODO] move this to the _update_general_settings() block _general_settings = config_data.get("general_settings", {}) if "alerting" in _general_settings: - general_settings["alerting"] = _general_settings["alerting"] - proxy_logging_obj.alerting = general_settings["alerting"] - proxy_logging_obj.slack_alerting_instance.alerting = general_settings[ - "alerting" - ] + if ( + general_settings["alerting"] is not None + and isinstance(general_settings["alerting"], list) + and _general_settings["alerting"] is not None + and isinstance(_general_settings["alerting"], list) + ): + for alert in _general_settings["alerting"]: + if alert not in general_settings["alerting"]: + general_settings["alerting"].append(alert) + + proxy_logging_obj.alerting = general_settings["alerting"] + proxy_logging_obj.slack_alerting_instance.alerting = general_settings[ + "alerting" + ] if "alert_types" in _general_settings: general_settings["alert_types"] = _general_settings["alert_types"] @@ -10897,10 +10912,10 @@ async def update_config(config_info: ConfigYAML): if k == "alert_to_webhook_url": # check if slack is already enabled. if not, enable it if "alerting" not in _existing_settings: - _existing_settings["alerting"] = ["slack"] + _existing_settings["alerting"].append("slack") elif isinstance(_existing_settings["alerting"], list): if "slack" not in _existing_settings["alerting"]: - _existing_settings["alerting"] = ["slack"] + _existing_settings["alerting"].append("slack") _existing_settings[k] = v config["general_settings"] = _existing_settings @@ -11386,6 +11401,36 @@ async def get_config(): "alerts_to_webhook": _alerts_to_webhook, } ) + # pass email alerting vars + _email_vars = [ + "SMTP_HOST", + "SMTP_PORT", + "SMTP_USERNAME", + "SMTP_PASSWORD", + "SMTP_SENDER_EMAIL", + "TEST_EMAIL_ADDRESS", + "EMAIL_LOGO_URL", + "EMAIL_SUPPORT_CONTACT", + ] + _email_env_vars = {} + for _var in _email_vars: + env_variable = environment_variables.get(_var, None) + if env_variable is None: + _email_env_vars[_var] = None + else: + # decode + decrypt the value + decoded_b64 = base64.b64decode(env_variable) + _decrypted_value = decrypt_value( + value=decoded_b64, master_key=master_key + ) + _email_env_vars[_var] = _decrypted_value + + alerting_data.append( + { + "name": "email", + "variables": _email_env_vars, + } + ) if llm_router is None: _router_settings = {} @@ -11472,7 +11517,7 @@ async def test_endpoint(request: Request): async def health_services_endpoint( user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth), service: Literal[ - "slack_budget_alerts", "langfuse", "slack", "openmeter", "webhook" + "slack_budget_alerts", "langfuse", "slack", "openmeter", "webhook", "email" ] = fastapi.Query(description="Specify the service being hit."), ): """ @@ -11489,6 +11534,7 @@ async def health_services_endpoint( ) if service not in [ "slack_budget_alerts", + "email", "langfuse", "slack", "openmeter", @@ -11621,6 +11667,32 @@ async def health_services_endpoint( ) }, ) + if service == "email": + webhook_event = WebhookEvent( + event="key_created", + event_group="key", + event_message="Test Email Alert", + token=user_api_key_dict.token or "", + key_alias="Email Test key (This is only a test alert key. DO NOT USE THIS IN PRODUCTION.)", + spend=0, + max_budget=0, + user_id=user_api_key_dict.user_id, + user_email=os.getenv("TEST_EMAIL_ADDRESS"), + team_id=user_api_key_dict.team_id, + ) + + # use create task - this can take 10 seconds. don't keep ui users waiting for notification to check their email + asyncio.create_task( + proxy_logging_obj.slack_alerting_instance.send_key_created_email( + webhook_event=webhook_event + ) + ) + + return { + "status": "success", + "message": "Mock Email Alert sent, verify Email Alert Received", + } + except Exception as e: traceback.print_exc() if isinstance(e, HTTPException): From 66feb7f8841920e3a8bdf79564c090033bbc06d2 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Mon, 27 May 2024 23:21:16 -0700 Subject: [PATCH 018/136] feat -working email settins --- .../src/components/settings.tsx | 131 +++++++++++++++--- 1 file changed, 112 insertions(+), 19 deletions(-) diff --git a/ui/litellm-dashboard/src/components/settings.tsx b/ui/litellm-dashboard/src/components/settings.tsx index badea63416..b1c6587bdb 100644 --- a/ui/litellm-dashboard/src/components/settings.tsx +++ b/ui/litellm-dashboard/src/components/settings.tsx @@ -571,26 +571,119 @@ const Settings: React.FC = ({ - A key is created for a specific user_id
- A key belonging to a user crosses its budget */} - Setup -
- {alerts - .filter((alert) => alert.name == "email") - .map((alert, index) => ( - -
    - {Object.entries(alert.variables ?? {}) - - .map(([key, value]) => ( -
  • - {key} - -
  • - ))} -
-
- ))} +Email Settings +
+ {alerts + .filter((alert) => alert.name === "email") + .map((alert, index) => ( + -
+
    + + {Object.entries(alert.variables ?? {}).map(([key, value]) => ( +
  • + + { premiumUser!= true && (key === "EMAIL_LOGO_URL" || key === "EMAIL_SUPPORT_CONTACT") ? ( + + + ) : ( +
    + {key} + +
    + + )} + + {/* Added descriptions for input fields */} +

    + {key === "SMTP_HOST" && ( +

    + Enter the SMTP host address, e.g. 'smtp.resend.com' + Required * +
    + + )} + + {key === "SMTP_PORT" && ( +
    + Enter the SMTP port number, e.g. '587' + Required * + +
    + + )} + + {key === "SMTP_USERNAME" && ( +
    + Enter the SMTP username, e.g. 'username' + Required * +
    + + )} + + {key === "SMTP_PASSWORD" && ( + Required * + )} + + {key === "SMTP_SENDER_EMAIL" && ( +
    + Enter the sender email address, e.g. 'sender@berri.ai' + Required * + +
    + )} + + {key === "TEST_EMAIL_ADDRESS" && ( +
    + Email Address to send 'Test Email Alert' to. example: 'info@berri.ai' + Required * +
    + ) + } + {key === "EMAIL_LOGO_URL" && ( +
    + (Optional) Customize the Logo that appears in the email, pass a url to your logo +
    + ) + } + {key === "EMAIL_SUPPORT_CONTACT" && ( +
    + (Optional) Customize the support email address that appears in the email. Default is support@berri.ai +
    + ) + } +

    +
  • + ))} +
    +
+ + ))} +
+ + + + + + + ); +}; + +export default EditUserModal; \ No newline at end of file diff --git a/ui/litellm-dashboard/src/components/leftnav.tsx b/ui/litellm-dashboard/src/components/leftnav.tsx index 89a50ad939..a5b8038221 100644 --- a/ui/litellm-dashboard/src/components/leftnav.tsx +++ b/ui/litellm-dashboard/src/components/leftnav.tsx @@ -79,7 +79,7 @@ const Sidebar: React.FC = ({ {userRole == "Admin" ? ( setPage("users")}> - Users + Internal Users ) : null} diff --git a/ui/litellm-dashboard/src/components/view_users.tsx b/ui/litellm-dashboard/src/components/view_users.tsx index 3faf4c0268..c631ff510a 100644 --- a/ui/litellm-dashboard/src/components/view_users.tsx +++ b/ui/litellm-dashboard/src/components/view_users.tsx @@ -28,8 +28,14 @@ import { userInfoCall } from "./networking"; import { Badge, BadgeDelta, Button } from "@tremor/react"; import RequestAccess from "./request_model_access"; import CreateUser from "./create_user_button"; +import EditUserModal from "./edit_user"; import Paragraph from "antd/es/skeleton/Paragraph"; -import InformationCircleIcon from "@heroicons/react/outline/InformationCircleIcon"; +import { + PencilAltIcon, + InformationCircleIcon, + TrashIcon, +} from "@heroicons/react/outline"; + interface ViewUserDashboardProps { accessToken: string | null; @@ -55,8 +61,32 @@ const ViewUserDashboard: React.FC = ({ const [currentPage, setCurrentPage] = useState(0); const [openDialogId, setOpenDialogId] = React.useState(null); const [selectedItem, setSelectedItem] = useState(null); + const [editModalVisible, setEditModalVisible] = useState(false); + const [selectedUser, setSelectedUser] = useState(null); const defaultPageSize = 25; + const handleEditClick = (user) => { + console.log("handleEditClick:", user); + setSelectedUser(user); + setEditModalVisible(true); + }; + + const handleEditCancel = () => { + setEditModalVisible(false); + setSelectedUser(null); + }; + + const handleEditSubmit = async (editedUser) => { + // Call your API to update the user with editedUser data + // ... + + // Update the userData state with the updated user data + const updatedUserData = userData.map((user) => + user.user_id === editedUser.user_id ? editedUser : user + ); + setUserData(updatedUserData); + }; + useEffect(() => { if (!accessToken || !token || !userRole || !userID) { return; @@ -146,7 +176,8 @@ const ViewUserDashboard: React.FC = ({ User Models User Spend ($ USD) User Max Budget ($ USD) - User API Key Aliases + API Keys + @@ -173,9 +204,13 @@ const ViewUserDashboard: React.FC = ({ (key: any) => key !== null ).length > 0 ? ( - {user.key_aliases - .filter((key: any) => key !== null) - .join(", ")} + { + user.key_aliases.filter( + (key: any) => key !== null + ).length + + } +  Keys ) : ( @@ -188,12 +223,28 @@ const ViewUserDashboard: React.FC = ({ )} {/* {user.key_aliases.filter(key => key !== null).length} Keys */} - {/* { + + + + + { setOpenDialogId(user.user_id) setSelectedItem(user) - }}>View Keys */} - + }}>View Keys + + + { + handleEditClick(user) + }}>View Keys + + { + setOpenDialogId(user.user_id) + setSelectedItem(user) + }}>View Keys + + + ))} @@ -226,30 +277,15 @@ const ViewUserDashboard: React.FC = ({ + {renderPagination()} - {/* { - setOpenDialogId(null); - }} - -> - -
- Key Aliases - - - {selectedItem && selectedItem.key_aliases - ? selectedItem.key_aliases.filter(key => key !== null).length > 0 - ? selectedItem.key_aliases.filter(key => key !== null).join(', ') - : 'No Keys' - : "No Keys"} - -
-
-
*/} ); }; From f729370890e36c1f23ccf73839a5924e69e18766 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 29 May 2024 15:59:32 -0700 Subject: [PATCH 069/136] feat(proxy_server.py): emit webhook event whenever customer spend is tracked Closes https://github.com/BerriAI/litellm/issues/3903 --- litellm/integrations/slack_alerting.py | 36 +++++++++++++- litellm/proxy/_types.py | 10 +++- litellm/proxy/proxy_server.py | 68 ++++++++------------------ litellm/tests/test_alerting.py | 30 ++++++++++++ 4 files changed, 92 insertions(+), 52 deletions(-) diff --git a/litellm/integrations/slack_alerting.py b/litellm/integrations/slack_alerting.py index 8fa1be8915..c1fdc553b9 100644 --- a/litellm/integrations/slack_alerting.py +++ b/litellm/integrations/slack_alerting.py @@ -684,14 +684,16 @@ class SlackAlerting(CustomLogger): event: Optional[ Literal["budget_crossed", "threshold_crossed", "projected_limit_exceeded"] ] = None - event_group: Optional[Literal["user", "team", "key", "proxy"]] = None + event_group: Optional[ + Literal["internal_user", "team", "key", "proxy", "customer"] + ] = None event_message: str = "" webhook_event: Optional[WebhookEvent] = None if type == "proxy_budget": event_group = "proxy" event_message += "Proxy Budget: " elif type == "user_budget": - event_group = "user" + event_group = "internal_user" event_message += "User Budget: " _id = user_info.user_id or _id elif type == "team_budget": @@ -755,6 +757,36 @@ class SlackAlerting(CustomLogger): return return + async def customer_spend_alert( + self, + token: Optional[str], + key_alias: Optional[str], + end_user_id: Optional[str], + response_cost: Optional[float], + max_budget: Optional[float], + ): + if end_user_id is not None and token is not None and response_cost is not None: + # log customer spend + event = WebhookEvent( + spend=response_cost, + max_budget=max_budget, + token=token, + customer_id=end_user_id, + user_id=None, + team_id=None, + user_email=None, + key_alias=key_alias, + projected_exceeded_date=None, + projected_spend=None, + event="spend_tracked", + event_group="customer", + event_message="Customer spend tracked. Customer={}, spend={}".format( + end_user_id, response_cost + ), + ) + + await self.send_webhook_alert(webhook_event=event) + def _count_outage_alerts(self, alerts: List[int]) -> str: """ Parameters: diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py index 07812a756d..555254a633 100644 --- a/litellm/proxy/_types.py +++ b/litellm/proxy/_types.py @@ -1051,6 +1051,7 @@ class LiteLLM_VerificationTokenView(LiteLLM_VerificationToken): end_user_id: Optional[str] = None end_user_tpm_limit: Optional[int] = None end_user_rpm_limit: Optional[int] = None + end_user_max_budget: Optional[float] = None class UserAPIKeyAuth( @@ -1178,6 +1179,7 @@ class CallInfo(LiteLLMBase): spend: float max_budget: Optional[float] = None token: str = Field(description="Hashed value of that key") + customer_id: Optional[str] = None user_id: Optional[str] = None team_id: Optional[str] = None user_email: Optional[str] = None @@ -1188,9 +1190,13 @@ class CallInfo(LiteLLMBase): class WebhookEvent(CallInfo): event: Literal[ - "budget_crossed", "threshold_crossed", "projected_limit_exceeded", "key_created" + "budget_crossed", + "threshold_crossed", + "projected_limit_exceeded", + "key_created", + "spend_tracked", ] - event_group: Literal["user", "key", "team", "proxy"] + event_group: Literal["internal_user", "key", "team", "proxy", "customer"] event_message: str # human-readable description of event diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 6efa150a44..2e9c256658 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -717,6 +717,10 @@ async def user_api_key_auth( end_user_params["end_user_rpm_limit"] = ( budget_info.rpm_limit ) + if budget_info.max_budget is not None: + end_user_params["end_user_max_budget"] = ( + budget_info.max_budget + ) except Exception as e: verbose_proxy_logger.debug( "Unable to find user in db. Error - {}".format(str(e)) @@ -1568,6 +1572,10 @@ async def _PROXY_track_cost_callback( user_id = kwargs["litellm_params"]["metadata"].get("user_api_key_user_id", None) team_id = kwargs["litellm_params"]["metadata"].get("user_api_key_team_id", None) org_id = kwargs["litellm_params"]["metadata"].get("user_api_key_org_id", None) + key_alias = kwargs["litellm_params"]["metadata"].get("user_api_key_alias", None) + end_user_max_budget = kwargs["litellm_params"]["metadata"].get( + "user_api_end_user_max_budget", None + ) if kwargs.get("response_cost", None) is not None: response_cost = kwargs["response_cost"] user_api_key = kwargs["litellm_params"]["metadata"].get( @@ -1604,6 +1612,14 @@ async def _PROXY_track_cost_callback( end_user_id=end_user_id, response_cost=response_cost, ) + + await proxy_logging_obj.slack_alerting_instance.customer_spend_alert( + token=user_api_key, + key_alias=key_alias, + end_user_id=end_user_id, + response_cost=response_cost, + max_budget=end_user_max_budget, + ) else: raise Exception( "User API key and team id and user id missing from custom callback." @@ -3959,6 +3975,10 @@ async def chat_completion( data["metadata"]["user_api_key_alias"] = getattr( user_api_key_dict, "key_alias", None ) + data["metadata"]["user_api_end_user_max_budget"] = getattr( + user_api_key_dict, "end_user_max_budget", None + ) + data["metadata"]["global_max_parallel_requests"] = general_settings.get( "global_max_parallel_requests", None ) @@ -13102,54 +13122,6 @@ async def token_generate(): return {"token": token} -# @router.post("/update_database", dependencies=[Depends(user_api_key_auth)]) -# async def update_database_endpoint( -# user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth), -# ): -# """ -# Test endpoint. DO NOT MERGE IN PROD. - -# Used for isolating and testing our prisma db update logic in high-traffic. -# """ -# try: -# request_id = f"chatcmpl-e41836bb-bb8b-4df2-8e70-8f3e160155ac{time.time()}" -# resp = litellm.ModelResponse( -# id=request_id, -# choices=[ -# litellm.Choices( -# finish_reason=None, -# index=0, -# message=litellm.Message( -# content=" Sure! Here is a short poem about the sky:\n\nA canvas of blue, a", -# role="assistant", -# ), -# ) -# ], -# model="gpt-35-turbo", # azure always has model written like this -# usage=litellm.Usage( -# prompt_tokens=210, completion_tokens=200, total_tokens=410 -# ), -# ) -# await _PROXY_track_cost_callback( -# kwargs={ -# "model": "chatgpt-v-2", -# "stream": False, -# "litellm_params": { -# "metadata": { -# "user_api_key": user_api_key_dict.token, -# "user_api_key_user_id": user_api_key_dict.user_id, -# } -# }, -# "response_cost": 0.00002, -# }, -# completion_response=resp, -# start_time=datetime.now(), -# end_time=datetime.now(), -# ) -# except Exception as e: -# raise e - - def _has_user_setup_sso(): """ Check if the user has set up single sign-on (SSO) by verifying the presence of Microsoft client ID, Google client ID, and UI username environment variables. diff --git a/litellm/tests/test_alerting.py b/litellm/tests/test_alerting.py index 4bb2bd9369..19e0e719ff 100644 --- a/litellm/tests/test_alerting.py +++ b/litellm/tests/test_alerting.py @@ -499,6 +499,36 @@ async def test_webhook_alerting(alerting_type): mock_send_alert.assert_awaited_once() +# @pytest.mark.asyncio +# async def test_webhook_customer_spend_event(): +# """ +# Test if customer spend is working as expected +# """ +# slack_alerting = SlackAlerting(alerting=["webhook"]) + +# with patch.object( +# slack_alerting, "send_webhook_alert", new=AsyncMock() +# ) as mock_send_alert: +# user_info = { +# "token": "50e55ca5bfbd0759697538e8d23c0cd5031f52d9e19e176d7233b20c7c4d3403", +# "spend": 1, +# "max_budget": 0, +# "user_id": "ishaan@berri.ai", +# "user_email": "ishaan@berri.ai", +# "key_alias": "my-test-key", +# "projected_exceeded_date": "10/20/2024", +# "projected_spend": 200, +# } + +# user_info = CallInfo(**user_info) +# for _ in range(50): +# await slack_alerting.budget_alerts( +# type=alerting_type, +# user_info=user_info, +# ) +# mock_send_alert.assert_awaited_once() + + @pytest.mark.parametrize( "model, api_base, llm_provider, vertex_project, vertex_location", [ From 1d18ca6a7dc4334efa11cc2ba11c0c79dca59eb9 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 29 May 2024 16:14:57 -0700 Subject: [PATCH 070/136] fix(router.py): security fix - don't show api key in invalid model setup error message --- litellm/router.py | 11 ++++++++++- litellm/tests/test_router.py | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/litellm/router.py b/litellm/router.py index c79dc2de09..d7535a83ae 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -2610,8 +2610,17 @@ class Router: if "azure" in model_name: if api_base is None or not isinstance(api_base, str): + filtered_litellm_params = { + k: v + for k, v in model["litellm_params"].items() + if k != "api_key" + } + _filtered_model = { + "model_name": model["model_name"], + "litellm_params": filtered_litellm_params, + } raise ValueError( - f"api_base is required for Azure OpenAI. Set it on your config. Model - {model}" + f"api_base is required for Azure OpenAI. Set it on your config. Model - {_filtered_model}" ) azure_ad_token = litellm_params.get("azure_ad_token") if azure_ad_token is not None: diff --git a/litellm/tests/test_router.py b/litellm/tests/test_router.py index ed35321132..d76dec25c7 100644 --- a/litellm/tests/test_router.py +++ b/litellm/tests/test_router.py @@ -19,6 +19,25 @@ import os, httpx load_dotenv() +def test_router_sensitive_keys(): + try: + router = Router( + model_list=[ + { + "model_name": "gpt-3.5-turbo", # openai model name + "litellm_params": { # params for litellm completion/embedding call + "model": "azure/chatgpt-v-2", + "api_key": "special-key", + }, + "model_info": {"id": 12345}, + }, + ], + ) + except Exception as e: + print(f"error msg - {str(e)}") + assert "special-key" not in str(e) + + @pytest.mark.parametrize("num_retries", [None, 2]) @pytest.mark.parametrize("max_retries", [None, 4]) def test_router_num_retries_init(num_retries, max_retries): From 77cc9cded9ff4dfa86ad24f3a379eee7d02b3272 Mon Sep 17 00:00:00 2001 From: Krish Dholakia Date: Wed, 29 May 2024 16:30:09 -0700 Subject: [PATCH 071/136] Revert "fix: Log errors in Traceloop Integration (reverts previous revert)" --- litellm/integrations/traceloop.py | 229 +++++++++++++----------------- litellm/tests/test_traceloop.py | 74 ++++++---- litellm/utils.py | 12 -- 3 files changed, 139 insertions(+), 176 deletions(-) diff --git a/litellm/integrations/traceloop.py b/litellm/integrations/traceloop.py index 39d62028e8..bbdb9a1b0a 100644 --- a/litellm/integrations/traceloop.py +++ b/litellm/integrations/traceloop.py @@ -1,153 +1,114 @@ -import traceback -from litellm._logging import verbose_logger -import litellm - - class TraceloopLogger: def __init__(self): - try: - from traceloop.sdk.tracing.tracing import TracerWrapper - from traceloop.sdk import Traceloop - from traceloop.sdk.instruments import Instruments - except ModuleNotFoundError as e: - verbose_logger.error( - f"Traceloop not installed, try running 'pip install traceloop-sdk' to fix this error: {e}\n{traceback.format_exc()}" - ) + from traceloop.sdk.tracing.tracing import TracerWrapper + from traceloop.sdk import Traceloop - Traceloop.init( - app_name="Litellm-Server", - disable_batch=True, - instruments=[ - Instruments.CHROMA, - Instruments.PINECONE, - Instruments.WEAVIATE, - Instruments.LLAMA_INDEX, - Instruments.LANGCHAIN, - ], - ) + Traceloop.init(app_name="Litellm-Server", disable_batch=True) self.tracer_wrapper = TracerWrapper() - def log_event( - self, - kwargs, - response_obj, - start_time, - end_time, - user_id, - print_verbose, - level="DEFAULT", - status_message=None, - ): - from opentelemetry import trace - from opentelemetry.trace import SpanKind, Status, StatusCode + def log_event(self, kwargs, response_obj, start_time, end_time, print_verbose): + from opentelemetry.trace import SpanKind from opentelemetry.semconv.ai import SpanAttributes try: - print_verbose( - f"Traceloop Logging - Enters logging function for model {kwargs}" - ) - tracer = self.tracer_wrapper.get_tracer() + model = kwargs.get("model") + + # LiteLLM uses the standard OpenAI library, so it's already handled by Traceloop SDK + if kwargs.get("litellm_params").get("custom_llm_provider") == "openai": + return + optional_params = kwargs.get("optional_params", {}) - span = tracer.start_span( - "litellm.completion", kind=SpanKind.CLIENT, start_time=start_time - ) + with tracer.start_as_current_span( + "litellm.completion", + kind=SpanKind.CLIENT, + ) as span: + if span.is_recording(): + span.set_attribute( + SpanAttributes.LLM_REQUEST_MODEL, kwargs.get("model") + ) + if "stop" in optional_params: + span.set_attribute( + SpanAttributes.LLM_CHAT_STOP_SEQUENCES, + optional_params.get("stop"), + ) + if "frequency_penalty" in optional_params: + span.set_attribute( + SpanAttributes.LLM_FREQUENCY_PENALTY, + optional_params.get("frequency_penalty"), + ) + if "presence_penalty" in optional_params: + span.set_attribute( + SpanAttributes.LLM_PRESENCE_PENALTY, + optional_params.get("presence_penalty"), + ) + if "top_p" in optional_params: + span.set_attribute( + SpanAttributes.LLM_TOP_P, optional_params.get("top_p") + ) + if "tools" in optional_params or "functions" in optional_params: + span.set_attribute( + SpanAttributes.LLM_REQUEST_FUNCTIONS, + optional_params.get( + "tools", optional_params.get("functions") + ), + ) + if "user" in optional_params: + span.set_attribute( + SpanAttributes.LLM_USER, optional_params.get("user") + ) + if "max_tokens" in optional_params: + span.set_attribute( + SpanAttributes.LLM_REQUEST_MAX_TOKENS, + kwargs.get("max_tokens"), + ) + if "temperature" in optional_params: + span.set_attribute( + SpanAttributes.LLM_TEMPERATURE, kwargs.get("temperature") + ) - if span.is_recording(): - span.set_attribute( - SpanAttributes.LLM_REQUEST_MODEL, kwargs.get("model") - ) - if "stop" in optional_params: - span.set_attribute( - SpanAttributes.LLM_CHAT_STOP_SEQUENCES, - optional_params.get("stop"), - ) - if "frequency_penalty" in optional_params: - span.set_attribute( - SpanAttributes.LLM_FREQUENCY_PENALTY, - optional_params.get("frequency_penalty"), - ) - if "presence_penalty" in optional_params: - span.set_attribute( - SpanAttributes.LLM_PRESENCE_PENALTY, - optional_params.get("presence_penalty"), - ) - if "top_p" in optional_params: - span.set_attribute( - SpanAttributes.LLM_TOP_P, optional_params.get("top_p") - ) - if "tools" in optional_params or "functions" in optional_params: - span.set_attribute( - SpanAttributes.LLM_REQUEST_FUNCTIONS, - optional_params.get("tools", optional_params.get("functions")), - ) - if "user" in optional_params: - span.set_attribute( - SpanAttributes.LLM_USER, optional_params.get("user") - ) - if "max_tokens" in optional_params: - span.set_attribute( - SpanAttributes.LLM_REQUEST_MAX_TOKENS, - kwargs.get("max_tokens"), - ) - if "temperature" in optional_params: - span.set_attribute( - SpanAttributes.LLM_REQUEST_TEMPERATURE, - kwargs.get("temperature"), - ) + for idx, prompt in enumerate(kwargs.get("messages")): + span.set_attribute( + f"{SpanAttributes.LLM_PROMPTS}.{idx}.role", + prompt.get("role"), + ) + span.set_attribute( + f"{SpanAttributes.LLM_PROMPTS}.{idx}.content", + prompt.get("content"), + ) - for idx, prompt in enumerate(kwargs.get("messages")): span.set_attribute( - f"{SpanAttributes.LLM_PROMPTS}.{idx}.role", - prompt.get("role"), - ) - span.set_attribute( - f"{SpanAttributes.LLM_PROMPTS}.{idx}.content", - prompt.get("content"), + SpanAttributes.LLM_RESPONSE_MODEL, response_obj.get("model") ) + usage = response_obj.get("usage") + if usage: + span.set_attribute( + SpanAttributes.LLM_USAGE_TOTAL_TOKENS, + usage.get("total_tokens"), + ) + span.set_attribute( + SpanAttributes.LLM_USAGE_COMPLETION_TOKENS, + usage.get("completion_tokens"), + ) + span.set_attribute( + SpanAttributes.LLM_USAGE_PROMPT_TOKENS, + usage.get("prompt_tokens"), + ) - span.set_attribute( - SpanAttributes.LLM_RESPONSE_MODEL, response_obj.get("model") - ) - usage = response_obj.get("usage") - if usage: - span.set_attribute( - SpanAttributes.LLM_USAGE_TOTAL_TOKENS, - usage.get("total_tokens"), - ) - span.set_attribute( - SpanAttributes.LLM_USAGE_COMPLETION_TOKENS, - usage.get("completion_tokens"), - ) - span.set_attribute( - SpanAttributes.LLM_USAGE_PROMPT_TOKENS, - usage.get("prompt_tokens"), - ) - - for idx, choice in enumerate(response_obj.get("choices")): - span.set_attribute( - f"{SpanAttributes.LLM_COMPLETIONS}.{idx}.finish_reason", - choice.get("finish_reason"), - ) - span.set_attribute( - f"{SpanAttributes.LLM_COMPLETIONS}.{idx}.role", - choice.get("message").get("role"), - ) - span.set_attribute( - f"{SpanAttributes.LLM_COMPLETIONS}.{idx}.content", - choice.get("message").get("content"), - ) - - if ( - level == "ERROR" - and status_message is not None - and isinstance(status_message, str) - ): - span.record_exception(Exception(status_message)) - span.set_status(Status(StatusCode.ERROR, status_message)) - - span.end(end_time) + for idx, choice in enumerate(response_obj.get("choices")): + span.set_attribute( + f"{SpanAttributes.LLM_COMPLETIONS}.{idx}.finish_reason", + choice.get("finish_reason"), + ) + span.set_attribute( + f"{SpanAttributes.LLM_COMPLETIONS}.{idx}.role", + choice.get("message").get("role"), + ) + span.set_attribute( + f"{SpanAttributes.LLM_COMPLETIONS}.{idx}.content", + choice.get("message").get("content"), + ) except Exception as e: print_verbose(f"Traceloop Layer Error - {e}") diff --git a/litellm/tests/test_traceloop.py b/litellm/tests/test_traceloop.py index f969736285..405a8a3574 100644 --- a/litellm/tests/test_traceloop.py +++ b/litellm/tests/test_traceloop.py @@ -1,35 +1,49 @@ -import sys -import os -import time -import pytest -import litellm -from opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter -from traceloop.sdk import Traceloop +# Commented out for now - since traceloop break ci/cd +# import sys +# import os +# import io, asyncio -sys.path.insert(0, os.path.abspath("../..")) +# sys.path.insert(0, os.path.abspath('../..')) + +# from litellm import completion +# import litellm +# litellm.num_retries = 3 +# litellm.success_callback = [""] +# import time +# import pytest +# from traceloop.sdk import Traceloop +# Traceloop.init(app_name="test-litellm", disable_batch=True) -@pytest.fixture() -def exporter(): - exporter = InMemorySpanExporter() - Traceloop.init( - app_name="test_litellm", - disable_batch=True, - exporter=exporter, - ) - litellm.success_callback = ["traceloop"] - litellm.set_verbose = True - - return exporter +# def test_traceloop_logging(): +# try: +# litellm.set_verbose = True +# response = litellm.completion( +# model="gpt-3.5-turbo", +# messages=[{"role": "user", "content":"This is a test"}], +# max_tokens=1000, +# temperature=0.7, +# timeout=5, +# ) +# print(f"response: {response}") +# except Exception as e: +# pytest.fail(f"An exception occurred - {e}") +# # test_traceloop_logging() -@pytest.mark.parametrize("model", ["claude-instant-1.2", "gpt-3.5-turbo"]) -def test_traceloop_logging(exporter, model): - - litellm.completion( - model=model, - messages=[{"role": "user", "content": "This is a test"}], - max_tokens=1000, - temperature=0.7, - timeout=5, - ) +# # def test_traceloop_logging_async(): +# # try: +# # litellm.set_verbose = True +# # async def test_acompletion(): +# # return await litellm.acompletion( +# # model="gpt-3.5-turbo", +# # messages=[{"role": "user", "content":"This is a test"}], +# # max_tokens=1000, +# # temperature=0.7, +# # timeout=5, +# # ) +# # response = asyncio.run(test_acompletion()) +# # print(f"response: {response}") +# # except Exception as e: +# # pytest.fail(f"An exception occurred - {e}") +# # test_traceloop_logging_async() diff --git a/litellm/utils.py b/litellm/utils.py index 95d9160efa..ea0f46c144 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -2027,7 +2027,6 @@ class Logging: response_obj=result, start_time=start_time, end_time=end_time, - user_id=kwargs.get("user", None), print_verbose=print_verbose, ) if callback == "s3": @@ -2599,17 +2598,6 @@ class Logging: level="ERROR", kwargs=self.model_call_details, ) - if callback == "traceloop": - traceloopLogger.log_event( - start_time=start_time, - end_time=end_time, - response_obj=None, - user_id=kwargs.get("user", None), - print_verbose=print_verbose, - status_message=str(exception), - level="ERROR", - kwargs=self.model_call_details, - ) if callback == "prometheus": global prometheusLogger verbose_logger.debug("reaches prometheus for success logging!") From 425a8fdb3ab8dccccc26cdab1e3de46d76215fe9 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 29 May 2024 16:45:30 -0700 Subject: [PATCH 072/136] feat - edit user --- .../src/components/edit_user.tsx | 51 +++++++++++-------- .../src/components/view_users.tsx | 38 +++++++------- 2 files changed, 52 insertions(+), 37 deletions(-) diff --git a/ui/litellm-dashboard/src/components/edit_user.tsx b/ui/litellm-dashboard/src/components/edit_user.tsx index 4ffc14f5b4..d1364c9a42 100644 --- a/ui/litellm-dashboard/src/components/edit_user.tsx +++ b/ui/litellm-dashboard/src/components/edit_user.tsx @@ -34,6 +34,15 @@ const EditUserModal: React.FC = ({ visible, onCancel, user, setEditedUser({ ...editedUser, [e.target.name]: e.target.value }); }; + const handleEditSubmit = async (formValues: Record) => { + // Call API to update team with teamId and values + + console.log("handleEditSubmit:", formValues); + onSubmit(formValues); + onCancel(); + }; + + const handleSubmit = () => { onSubmit(editedUser); onCancel(); @@ -45,15 +54,21 @@ const EditUserModal: React.FC = ({ visible, onCancel, user, return ( - + - + {/* {JSON.stringify(user)} - + */}
= ({ visible, onCancel, user, <> @@ -70,43 +86,38 @@ const EditUserModal: React.FC = ({ visible, onCancel, user, - - - - +
+ Save +
+ diff --git a/ui/litellm-dashboard/src/components/view_users.tsx b/ui/litellm-dashboard/src/components/view_users.tsx index c631ff510a..9f955488cc 100644 --- a/ui/litellm-dashboard/src/components/view_users.tsx +++ b/ui/litellm-dashboard/src/components/view_users.tsx @@ -24,7 +24,7 @@ import { Icon, TextInput, } from "@tremor/react"; -import { userInfoCall } from "./networking"; +import { userInfoCall, userUpdateUserCall } from "./networking"; import { Badge, BadgeDelta, Button } from "@tremor/react"; import RequestAccess from "./request_model_access"; import CreateUser from "./create_user_button"; @@ -65,26 +65,29 @@ const ViewUserDashboard: React.FC = ({ const [selectedUser, setSelectedUser] = useState(null); const defaultPageSize = 25; - const handleEditClick = (user) => { - console.log("handleEditClick:", user); - setSelectedUser(user); - setEditModalVisible(true); - }; - const handleEditCancel = () => { setEditModalVisible(false); setSelectedUser(null); }; - const handleEditSubmit = async (editedUser) => { - // Call your API to update the user with editedUser data - // ... - - // Update the userData state with the updated user data - const updatedUserData = userData.map((user) => - user.user_id === editedUser.user_id ? editedUser : user - ); - setUserData(updatedUserData); + const handleEditSubmit = async (editedUser: any) => { + console.log("inside handleEditSubmit:", editedUser); + + if (!accessToken || !token || !userRole || !userID) { + return; + } + + userUpdateUserCall(accessToken, editedUser, userRole); + + if (userData) { + const updatedUserData = userData.map((user) => + user.user_id === editedUser.user_id ? editedUser : user + ); + setUserData(updatedUserData); + } + setSelectedUser(null); + setEditModalVisible(false); + // Close the modal }; useEffect(() => { @@ -234,7 +237,8 @@ const ViewUserDashboard: React.FC = ({ { - handleEditClick(user) + setSelectedUser(user) + setEditModalVisible(true) }}>View Keys { From e9b5bf2d2f86b7dacbb8501a7ec354c1599422d4 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 29 May 2024 16:49:03 -0700 Subject: [PATCH 073/136] docs(customers.md): add webhook spend tracking events to customer docs --- docs/my-website/docs/proxy/alerting.md | 15 +++-- docs/my-website/docs/proxy/customers.md | 74 ++++++++++++++++++++++++- 2 files changed, 82 insertions(+), 7 deletions(-) diff --git a/docs/my-website/docs/proxy/alerting.md b/docs/my-website/docs/proxy/alerting.md index 9574a4dc34..3ef676bbd6 100644 --- a/docs/my-website/docs/proxy/alerting.md +++ b/docs/my-website/docs/proxy/alerting.md @@ -178,23 +178,26 @@ curl -X GET --location 'http://0.0.0.0:4000/health/services?service=webhook' \ } ``` -**API Spec for Webhook Event** +## **API Spec for Webhook Event** - `spend` *float*: The current spend amount for the 'event_group'. -- `max_budget` *float*: The maximum allowed budget for the 'event_group'. +- `max_budget` *float or null*: The maximum allowed budget for the 'event_group'. null if not set. - `token` *str*: A hashed value of the key, used for authentication or identification purposes. -- `user_id` *str or null*: The ID of the user associated with the event (optional). +- `customer_id` *str or null*: The ID of the customer associated with the event (optional). +- `internal_user_id` *str or null*: The ID of the internal user associated with the event (optional). - `team_id` *str or null*: The ID of the team associated with the event (optional). -- `user_email` *str or null*: The email of the user associated with the event (optional). +- `user_email` *str or null*: The email of the internal user associated with the event (optional). - `key_alias` *str or null*: An alias for the key associated with the event (optional). - `projected_exceeded_date` *str or null*: The date when the budget is projected to be exceeded, returned when 'soft_budget' is set for key (optional). - `projected_spend` *float or null*: The projected spend amount, returned when 'soft_budget' is set for key (optional). - `event` *Literal["budget_crossed", "threshold_crossed", "projected_limit_exceeded"]*: The type of event that triggered the webhook. Possible values are: + * "spend_tracked": Emitted whenver spend is tracked for a customer id. * "budget_crossed": Indicates that the spend has exceeded the max budget. * "threshold_crossed": Indicates that spend has crossed a threshold (currently sent when 85% and 95% of budget is reached). * "projected_limit_exceeded": For "key" only - Indicates that the projected spend is expected to exceed the soft budget threshold. -- `event_group` *Literal["user", "key", "team", "proxy"]*: The group associated with the event. Possible values are: - * "user": The event is related to a specific user. +- `event_group` *Literal["customer", "internal_user", "key", "team", "proxy"]*: The group associated with the event. Possible values are: + * "customer": The event is related to a specific customer + * "internal_user": The event is related to a specific internal user. * "key": The event is related to a specific key. * "team": The event is related to a team. * "proxy": The event is related to a proxy. diff --git a/docs/my-website/docs/proxy/customers.md b/docs/my-website/docs/proxy/customers.md index bd609322ab..230eec9d07 100644 --- a/docs/my-website/docs/proxy/customers.md +++ b/docs/my-website/docs/proxy/customers.md @@ -1,3 +1,6 @@ +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # 🙋‍♂️ Customers Track spend, set budgets for your customers. @@ -30,6 +33,11 @@ If the customer_id already exists, spend will be incremented. 2. Get Customer Spend + + + +Call `/customer/info` to get a customer's all up spend + ```bash curl -X GET 'http://0.0.0.0:4000/customer/info?end_user_id=ishaan3' \ # 👈 CUSTOMER ID -H 'Authorization: Bearer sk-1234' \ # 👈 YOUR PROXY KEY @@ -47,4 +55,68 @@ Expected Response: "default_model": null, "litellm_budget_table": null } -``` \ No newline at end of file +``` + + + + +To update spend in your client-side DB, point the proxy to your webhook. + +E.g. if your server is `https://webhook.site` and your listening on `6ab090e8-c55f-4a23-b075-3209f5c57906` + +1. Add webhook url to your proxy environment: + +```bash +export WEBHOOK_URL="https://webhook.site/6ab090e8-c55f-4a23-b075-3209f5c57906" +``` + +2. Add 'webhook' to config.yaml + +```yaml +general_settings: + alerting: ["webhook"] # 👈 KEY CHANGE +``` + +3. Test it! + +```bash +curl -X POST 'http://localhost:4000/chat/completions' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Bearer sk-1234' \ +-D '{ + "model": "mistral", + "messages": [ + { + "role": "user", + "content": "What's the weather like in Boston today?" + } + ], + "user": "krrish12" +} +' +``` + +Expected Response + +```json +{ + "spend": 0.0011120000000000001, # 👈 SPEND + "max_budget": null, + "token": "88dc28d0f030c55ed4ab77ed8faf098196cb1c05df778539800c9f1243fe6b4b", + "customer_id": "krrish12", # 👈 CUSTOMER ID + "user_id": null, + "team_id": null, + "user_email": null, + "key_alias": null, + "projected_exceeded_date": null, + "projected_spend": null, + "event": "spend_tracked", + "event_group": "customer", + "event_message": "Customer spend tracked. Customer=krrish12, spend=0.0011120000000000001" +} +``` + +[See Webhook Spec](./alerting.md#api-spec-for-webhook-event) + + + From cfcf5969c8fdf292c4036e7a9d35f8a3b670e84c Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 29 May 2024 17:20:59 -0700 Subject: [PATCH 074/136] fix(proxy_server.py): fix end user object check when master key used check if end user max budget exceeded for master key --- litellm/exceptions.py | 1 + litellm/integrations/slack_alerting.py | 4 +++- litellm/proxy/auth/auth_checks.py | 22 ++++++++++++++++++++-- litellm/proxy/proxy_server.py | 6 ++++++ 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/litellm/exceptions.py b/litellm/exceptions.py index d189b7ebe2..abddb108a6 100644 --- a/litellm/exceptions.py +++ b/litellm/exceptions.py @@ -314,6 +314,7 @@ class BudgetExceededError(Exception): self.current_cost = current_cost self.max_budget = max_budget message = f"Budget has been exceeded! Current cost: {current_cost}, Max budget: {max_budget}" + self.message = message super().__init__(message) diff --git a/litellm/integrations/slack_alerting.py b/litellm/integrations/slack_alerting.py index c1fdc553b9..08af885629 100644 --- a/litellm/integrations/slack_alerting.py +++ b/litellm/integrations/slack_alerting.py @@ -1443,7 +1443,9 @@ Model Info: if response.status_code == 200: pass else: - print("Error sending slack alert. Error=", response.text) # noqa + verbose_proxy_logger.debug( + "Error sending slack alert. Error=", response.text + ) async def async_log_success_event(self, kwargs, response_obj, start_time, end_time): """Log deployment latency""" diff --git a/litellm/proxy/auth/auth_checks.py b/litellm/proxy/auth/auth_checks.py index d06469b71f..a6e97960e5 100644 --- a/litellm/proxy/auth/auth_checks.py +++ b/litellm/proxy/auth/auth_checks.py @@ -193,13 +193,27 @@ async def get_end_user_object( if end_user_id is None: return None _key = "end_user_id:{}".format(end_user_id) + + def check_in_budget(end_user_obj: LiteLLM_EndUserTable): + if end_user_obj.litellm_budget_table is None: + return + end_user_budget = end_user_obj.litellm_budget_table.max_budget + if end_user_budget is not None and end_user_obj.spend > end_user_budget: + raise litellm.BudgetExceededError( + current_cost=end_user_obj.spend, max_budget=end_user_budget + ) + # check if in cache cached_user_obj = await user_api_key_cache.async_get_cache(key=_key) if cached_user_obj is not None: if isinstance(cached_user_obj, dict): - return LiteLLM_EndUserTable(**cached_user_obj) + return_obj = LiteLLM_EndUserTable(**cached_user_obj) + check_in_budget(end_user_obj=return_obj) + return return_obj elif isinstance(cached_user_obj, LiteLLM_EndUserTable): - return cached_user_obj + return_obj = cached_user_obj + check_in_budget(end_user_obj=return_obj) + return return_obj # else, check db try: response = await prisma_client.db.litellm_endusertable.find_unique( @@ -217,8 +231,12 @@ async def get_end_user_object( _response = LiteLLM_EndUserTable(**response.dict()) + check_in_budget(end_user_obj=_response) + return _response except Exception as e: # if end-user not in db + if isinstance(e, litellm.BudgetExceededError): + raise e return None diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 2e9c256658..f75a1e9d19 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -722,6 +722,8 @@ async def user_api_key_auth( budget_info.max_budget ) except Exception as e: + if isinstance(e, litellm.BudgetExceededError): + raise e verbose_proxy_logger.debug( "Unable to find user in db. Error - {}".format(str(e)) ) @@ -1410,6 +1412,10 @@ async def user_api_key_auth( raise Exception() except Exception as e: traceback.print_exc() + if isinstance(e, litellm.BudgetExceededError): + raise ProxyException( + message=e.message, type="auth_error", param=None, code=400 + ) if isinstance(e, HTTPException): raise ProxyException( message=getattr(e, "detail", f"Authentication Error({str(e)})"), From 1dfc391a2bc5d5391765a2f71d007c93c38ae5eb Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 29 May 2024 17:28:29 -0700 Subject: [PATCH 075/136] ui - edit interal user flow --- .../src/components/edit_user.tsx | 26 +++++++++++++------ .../src/components/view_users.tsx | 4 +-- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/ui/litellm-dashboard/src/components/edit_user.tsx b/ui/litellm-dashboard/src/components/edit_user.tsx index d1364c9a42..425ee0be09 100644 --- a/ui/litellm-dashboard/src/components/edit_user.tsx +++ b/ui/litellm-dashboard/src/components/edit_user.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react'; +import { useEffect, useState } from 'react'; import { Dialog, DialogPanel, @@ -7,6 +7,8 @@ import { Select, SelectItem, Text, + Title, + Subtitle, } from '@tremor/react'; import { @@ -30,23 +32,28 @@ const EditUserModal: React.FC = ({ visible, onCancel, user, const [editedUser, setEditedUser] = useState(user); const [form] = Form.useForm(); + useEffect(() => { + form.resetFields(); + }, [user]); + const handleChange = (e) => { setEditedUser({ ...editedUser, [e.target.name]: e.target.value }); }; + const handleCancel = async () => { + form.resetFields(); + onCancel(); + }; + const handleEditSubmit = async (formValues: Record) => { // Call API to update team with teamId and values + form.resetFields(); - console.log("handleEditSubmit:", formValues); onSubmit(formValues); onCancel(); }; - const handleSubmit = () => { - onSubmit(editedUser); - onCancel(); - }; if (!user) { return null; @@ -56,16 +63,19 @@ const EditUserModal: React.FC = ({ visible, onCancel, user, {/* {JSON.stringify(user)} */} + + + Edit User {user.user_id} +
= ({ const [selectedUser, setSelectedUser] = useState(null); const defaultPageSize = 25; - const handleEditCancel = () => { - setEditModalVisible(false); + const handleEditCancel = async () => { setSelectedUser(null); + setEditModalVisible(false); }; const handleEditSubmit = async (editedUser: any) => { From 07b1f1135daa34a97e4f95e4d41f0391bfcd6cd0 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 29 May 2024 17:34:37 -0700 Subject: [PATCH 076/136] fix edit user title --- ui/litellm-dashboard/src/components/edit_user.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ui/litellm-dashboard/src/components/edit_user.tsx b/ui/litellm-dashboard/src/components/edit_user.tsx index 425ee0be09..d7bad4acd2 100644 --- a/ui/litellm-dashboard/src/components/edit_user.tsx +++ b/ui/litellm-dashboard/src/components/edit_user.tsx @@ -65,17 +65,11 @@ const EditUserModal: React.FC = ({ visible, onCancel, user, visible={visible} onCancel={handleCancel} footer={null} + title={"Edit User " + user.user_id} width={1000} > - {/* - {JSON.stringify(user)} - - */} - - Edit User {user.user_id} - Date: Wed, 29 May 2024 17:46:30 -0700 Subject: [PATCH 077/136] ui - edit roles --- ui/litellm-dashboard/src/components/edit_user.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ui/litellm-dashboard/src/components/edit_user.tsx b/ui/litellm-dashboard/src/components/edit_user.tsx index d7bad4acd2..4a822c4d12 100644 --- a/ui/litellm-dashboard/src/components/edit_user.tsx +++ b/ui/litellm-dashboard/src/components/edit_user.tsx @@ -68,8 +68,6 @@ const EditUserModal: React.FC = ({ visible, onCancel, user, title={"Edit User " + user.user_id} width={1000} > - - = ({ visible, onCancel, user, label="User Role" name="user_role" > - + + Proxy Admin (Can create, edit, delete keys, teams) + Proxy Viewer (Can just view spend, cannot created keys, teams) + + Date: Wed, 29 May 2024 17:46:39 -0700 Subject: [PATCH 078/136] docs(customers.md): tutorial for setting customer budgets on proxy --- docs/my-website/docs/proxy/customers.md | 133 +++++++++++++++++- docs/my-website/img/create_budget_modal.png | Bin 0 -> 197772 bytes .../src/components/leftnav.tsx | 2 +- 3 files changed, 132 insertions(+), 3 deletions(-) create mode 100644 docs/my-website/img/create_budget_modal.png diff --git a/docs/my-website/docs/proxy/customers.md b/docs/my-website/docs/proxy/customers.md index 230eec9d07..94000cde27 100644 --- a/docs/my-website/docs/proxy/customers.md +++ b/docs/my-website/docs/proxy/customers.md @@ -1,3 +1,4 @@ +import Image from '@theme/IdealImage'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; @@ -7,7 +8,7 @@ Track spend, set budgets for your customers. ## Tracking Customer Credit -1. Track LLM API Spend by Customer ID +### 1. Make LLM API call w/ Customer ID Make a /chat/completions call, pass 'user' - First call Works @@ -31,7 +32,7 @@ The customer_id will be upserted into the DB with the new spend. If the customer_id already exists, spend will be incremented. -2. Get Customer Spend +### 2. Get Customer Spend @@ -120,3 +121,131 @@ Expected Response + + +## Setting Customer Budgets + +Set customer budgets (e.g. monthly budgets, tpm/rpm limits) on LiteLLM Proxy + +### Quick Start + +Create / Update a customer with budget + +**Create New Customer w/ budget** +```bash +curl -X POST 'http://0.0.0.0:4000/customer/new' + -H 'Authorization: Bearer sk-1234' + -H 'Content-Type: application/json' + -D '{ + "user_id" : "my-customer-id", + "max_budget": "0", # 👈 CAN BE FLOAT + }' +``` + +**Test it!** + +```bash +curl -X POST 'http://localhost:4000/chat/completions' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Bearer sk-1234' \ +-D '{ + "model": "mistral", + "messages": [ + { + "role": "user", + "content": "What'\''s the weather like in Boston today?" + } + ], + "user": "ishaan-jaff-48" +} +``` + +### Assign Pricing Tiers + +Create and assign customers to pricing tiers. + +#### 1. Create a budget + + + + +- Go to the 'Budgets' tab on the UI. +- Click on '+ Create Budget'. +- Create your pricing tier (e.g. 'my-free-tier' with budget $4). This means each user on this pricing tier will have a max budget of $4. + + + + + + +Use the `/budget/new` endpoint for creating a new budget. [API Reference](https://litellm-api.up.railway.app/#/budget%20management/new_budget_budget_new_post) + +```bash +curl -X POST 'http://localhost:4000/budget/new' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Bearer sk-1234' \ +-D '{ + "budget_id": "my-free-tier", + "max_budget": 4 +} +``` + + + + + +#### 2. Assign Budget to Customer + +In your application code, assign budget when creating a new customer. + +Just use the `budget_id` used when creating the budget. In our example, this is `my-free-tier`. + +```bash +curl -X POST 'http://localhost:4000/customer/new' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Bearer sk-1234' \ +-D '{ + "user_id": "my-customer-id", + "budget_id": "my-free-tier" # 👈 KEY CHANGE +} +``` + +#### 3. Test it! + + + + +```bash +curl -X POST 'http://localhost:4000/customer/new' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Bearer sk-1234' \ +-D '{ + "user_id": "my-customer-id", + "budget_id": "my-free-tier" # 👈 KEY CHANGE +} +``` + + + + +```python +from openai import OpenAI +client = OpenAI( + base_url=" + \ No newline at end of file diff --git a/docs/my-website/img/create_budget_modal.png b/docs/my-website/img/create_budget_modal.png new file mode 100644 index 0000000000000000000000000000000000000000..0e307be5ed3419ae7f642b4697d0c8829b4d8da7 GIT binary patch literal 197772 zcmeFZc{r4P`#+vFN+Ggj86lJ{d)a1`wXBuwMwWz-WvpW~b>C$d$(kjEY-5*Qx7}cr zWke{9Z7eai!SKDN=XpNI@%{di=l|cQ4#!NIxvuwep0D$DzTW3~g&OK>ojG;k)QJ-( z&gf{X-#KxDF6_h!nlw6E;5Rf%mZyOi3a>j_H%=7yaW4S>@N+QLd8ns%;tKGd?gTZ( zg%dR7j{r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#WPLUTRjv0LUoAO7`k zl{Fr3yG(j)T~CU?N}d{9&`G7^&d%^K<3AxZil@ypN(o<_Afi?0cjdG66PZc{l|qy-xhG`y%k1qj}li}jX(@^_YS4$O^x|e@CC#U zsdjz>@F9^~CPtArx!?}9zDcRVWuP=%=&d6GsfbGX!nbyWKXRkCY}qD#$?&}8-P+j$ zV}^$#%*Lj+XAF`2%2@l}QEnP{8*JKi^p{UfJ=Lc0N-csJJCs&4r9|#B19G~$Sia=? zmo148ZP$KvB{RN)`IureH6;p)>gH8oA*hbcCO!XT*9m&OjovIGeV4Al13Wi(f8b|; zg3eE7di-eiFABOZ@A5xkVyHQKi-lT9rT|yp+0svRO&3oZ@TFV*?A`t+vkbFiUarH4 zm5ixe@($_J#AsRWYzIFY{m=fGbWotbd8MtTytf=o@eCyNcA4?$r2sJc``Y*km3w8v zW8EHzSHqF2euP4z4ZBys>1&&4<(JdXud)vCk5Ml?khMcU-EQuQT|4p{D((=7StJL& zFU&(Ax*_zxV?am7baskZV8r+z)On9gcrd zd)rM-ytSNJlzO6T{h4PVh__doKeK;-D!kCGr2EdwJE&1!f6+JRB3!g=IF8? = ({ {userRole == "Admin" ? ( setPage("budgets")}> - Rate Limits + Budgets ) : null} From b7fcec8835a28b2021915ba0f730d71c3c0307b7 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 29 May 2024 17:51:39 -0700 Subject: [PATCH 079/136] fix batch tags --- litellm/proxy/proxy_server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 46b0bc663f..94f861cb1c 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -5222,12 +5222,12 @@ async def create_batch( @router.get( "/v1/batches{batch_id}", dependencies=[Depends(user_api_key_auth)], - tags=["Batch"], + tags=["batch"], ) @router.get( "/batches{batch_id}", dependencies=[Depends(user_api_key_auth)], - tags=["Batch"], + tags=["batch"], ) async def retrieve_batch( request: Request, From 1744176e63004ffc2160c86084ceba700323eea5 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 29 May 2024 18:03:13 -0700 Subject: [PATCH 080/136] feat - langfuse show _user_api_key_alias as generation nam --- litellm/integrations/langfuse.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/litellm/integrations/langfuse.py b/litellm/integrations/langfuse.py index a9c67547d6..d1e8763c08 100644 --- a/litellm/integrations/langfuse.py +++ b/litellm/integrations/langfuse.py @@ -455,8 +455,14 @@ class LangFuseLogger: } generation_name = clean_metadata.pop("generation_name", None) if generation_name is None: - # just log `litellm-{call_type}` as the generation name - generation_name = f"litellm-{kwargs.get('call_type', 'completion')}" + # if `generation_name` is None, use sensible default values for generation_name + # If using litellm proxy user `key_alias` if not None + # If `key_alias` is None, just log `litellm-{call_type}` as the generation name + _user_api_key_alias = clean_metadata.get("user_api_key_alias", None) + generation_name = ( + _user_api_key_alias + or f"litellm-{kwargs.get('call_type', 'completion')}" + ) if response_obj is not None and "system_fingerprint" in response_obj: system_fingerprint = response_obj.get("system_fingerprint", None) From 673782ce48724118c2b541444702e65a5739621c Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 29 May 2024 18:03:59 -0700 Subject: [PATCH 081/136] test(test_auth_checks.py): add unit tests for customer max budget check --- litellm/tests/test_auth_checks.py | 62 +++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 litellm/tests/test_auth_checks.py diff --git a/litellm/tests/test_auth_checks.py b/litellm/tests/test_auth_checks.py new file mode 100644 index 0000000000..8bc8f7d140 --- /dev/null +++ b/litellm/tests/test_auth_checks.py @@ -0,0 +1,62 @@ +# What is this? +## Tests if 'get_end_user_object' works as expected + +import sys, os, asyncio, time, random, uuid +import traceback +from dotenv import load_dotenv + +load_dotenv() +import os + +sys.path.insert( + 0, os.path.abspath("../..") +) # Adds the parent directory to the system path +import pytest, litellm +from litellm.proxy.auth.auth_checks import get_end_user_object +from litellm.caching import DualCache +from litellm.proxy._types import LiteLLM_EndUserTable, LiteLLM_BudgetTable +from litellm.proxy.utils import PrismaClient + + +@pytest.mark.parametrize("customer_spend, customer_budget", [(0, 10), (10, 0)]) +@pytest.mark.asyncio +async def test_get_end_user_object(customer_spend, customer_budget): + """ + Scenario 1: normal + Scenario 2: user over budget + """ + end_user_id = "my-test-customer" + _budget = LiteLLM_BudgetTable(max_budget=customer_budget) + end_user_obj = LiteLLM_EndUserTable( + user_id=end_user_id, + spend=customer_spend, + litellm_budget_table=_budget, + blocked=False, + ) + _cache = DualCache() + _key = "end_user_id:{}".format(end_user_id) + _cache.set_cache(key=_key, value=end_user_obj) + try: + await get_end_user_object( + end_user_id=end_user_id, + prisma_client="RANDOM VALUE", # type: ignore + user_api_key_cache=_cache, + ) + if customer_spend > customer_budget: + pytest.fail( + "Expected call to fail. Customer Spend={}, Customer Budget={}".format( + customer_spend, customer_budget + ) + ) + except Exception as e: + if ( + isinstance(e, litellm.BudgetExceededError) + and customer_spend > customer_budget + ): + pass + else: + pytest.fail( + "Expected call to work. Customer Spend={}, Customer Budget={}, Error={}".format( + customer_spend, customer_budget, str(e) + ) + ) From b8d97c688cc695183072562bb994063e9fafdd93 Mon Sep 17 00:00:00 2001 From: Nir Gazit Date: Thu, 30 May 2024 04:02:20 +0300 Subject: [PATCH 082/136] Revert "Revert "fix: Log errors in Traceloop Integration (reverts previous revert)"" --- .circleci/config.yml | 2 +- litellm/integrations/traceloop.py | 229 +++++++++++++++++------------- litellm/tests/test_traceloop.py | 74 ++++------ litellm/utils.py | 12 ++ 4 files changed, 177 insertions(+), 140 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 27f79ed519..e6d988bae3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -43,7 +43,7 @@ jobs: pip install "langfuse==2.27.1" pip install "logfire==0.29.0" pip install numpydoc - pip install traceloop-sdk==0.18.2 + pip install traceloop-sdk==0.21.1 pip install openai pip install prisma pip install "httpx==0.24.1" diff --git a/litellm/integrations/traceloop.py b/litellm/integrations/traceloop.py index bbdb9a1b0a..39d62028e8 100644 --- a/litellm/integrations/traceloop.py +++ b/litellm/integrations/traceloop.py @@ -1,114 +1,153 @@ +import traceback +from litellm._logging import verbose_logger +import litellm + + class TraceloopLogger: def __init__(self): - from traceloop.sdk.tracing.tracing import TracerWrapper - from traceloop.sdk import Traceloop + try: + from traceloop.sdk.tracing.tracing import TracerWrapper + from traceloop.sdk import Traceloop + from traceloop.sdk.instruments import Instruments + except ModuleNotFoundError as e: + verbose_logger.error( + f"Traceloop not installed, try running 'pip install traceloop-sdk' to fix this error: {e}\n{traceback.format_exc()}" + ) - Traceloop.init(app_name="Litellm-Server", disable_batch=True) + Traceloop.init( + app_name="Litellm-Server", + disable_batch=True, + instruments=[ + Instruments.CHROMA, + Instruments.PINECONE, + Instruments.WEAVIATE, + Instruments.LLAMA_INDEX, + Instruments.LANGCHAIN, + ], + ) self.tracer_wrapper = TracerWrapper() - def log_event(self, kwargs, response_obj, start_time, end_time, print_verbose): - from opentelemetry.trace import SpanKind + def log_event( + self, + kwargs, + response_obj, + start_time, + end_time, + user_id, + print_verbose, + level="DEFAULT", + status_message=None, + ): + from opentelemetry import trace + from opentelemetry.trace import SpanKind, Status, StatusCode from opentelemetry.semconv.ai import SpanAttributes try: + print_verbose( + f"Traceloop Logging - Enters logging function for model {kwargs}" + ) + tracer = self.tracer_wrapper.get_tracer() - model = kwargs.get("model") - - # LiteLLM uses the standard OpenAI library, so it's already handled by Traceloop SDK - if kwargs.get("litellm_params").get("custom_llm_provider") == "openai": - return - optional_params = kwargs.get("optional_params", {}) - with tracer.start_as_current_span( - "litellm.completion", - kind=SpanKind.CLIENT, - ) as span: - if span.is_recording(): + span = tracer.start_span( + "litellm.completion", kind=SpanKind.CLIENT, start_time=start_time + ) + + if span.is_recording(): + span.set_attribute( + SpanAttributes.LLM_REQUEST_MODEL, kwargs.get("model") + ) + if "stop" in optional_params: span.set_attribute( - SpanAttributes.LLM_REQUEST_MODEL, kwargs.get("model") + SpanAttributes.LLM_CHAT_STOP_SEQUENCES, + optional_params.get("stop"), ) - if "stop" in optional_params: - span.set_attribute( - SpanAttributes.LLM_CHAT_STOP_SEQUENCES, - optional_params.get("stop"), - ) - if "frequency_penalty" in optional_params: - span.set_attribute( - SpanAttributes.LLM_FREQUENCY_PENALTY, - optional_params.get("frequency_penalty"), - ) - if "presence_penalty" in optional_params: - span.set_attribute( - SpanAttributes.LLM_PRESENCE_PENALTY, - optional_params.get("presence_penalty"), - ) - if "top_p" in optional_params: - span.set_attribute( - SpanAttributes.LLM_TOP_P, optional_params.get("top_p") - ) - if "tools" in optional_params or "functions" in optional_params: - span.set_attribute( - SpanAttributes.LLM_REQUEST_FUNCTIONS, - optional_params.get( - "tools", optional_params.get("functions") - ), - ) - if "user" in optional_params: - span.set_attribute( - SpanAttributes.LLM_USER, optional_params.get("user") - ) - if "max_tokens" in optional_params: - span.set_attribute( - SpanAttributes.LLM_REQUEST_MAX_TOKENS, - kwargs.get("max_tokens"), - ) - if "temperature" in optional_params: - span.set_attribute( - SpanAttributes.LLM_TEMPERATURE, kwargs.get("temperature") - ) - - for idx, prompt in enumerate(kwargs.get("messages")): - span.set_attribute( - f"{SpanAttributes.LLM_PROMPTS}.{idx}.role", - prompt.get("role"), - ) - span.set_attribute( - f"{SpanAttributes.LLM_PROMPTS}.{idx}.content", - prompt.get("content"), - ) - + if "frequency_penalty" in optional_params: span.set_attribute( - SpanAttributes.LLM_RESPONSE_MODEL, response_obj.get("model") + SpanAttributes.LLM_FREQUENCY_PENALTY, + optional_params.get("frequency_penalty"), + ) + if "presence_penalty" in optional_params: + span.set_attribute( + SpanAttributes.LLM_PRESENCE_PENALTY, + optional_params.get("presence_penalty"), + ) + if "top_p" in optional_params: + span.set_attribute( + SpanAttributes.LLM_TOP_P, optional_params.get("top_p") + ) + if "tools" in optional_params or "functions" in optional_params: + span.set_attribute( + SpanAttributes.LLM_REQUEST_FUNCTIONS, + optional_params.get("tools", optional_params.get("functions")), + ) + if "user" in optional_params: + span.set_attribute( + SpanAttributes.LLM_USER, optional_params.get("user") + ) + if "max_tokens" in optional_params: + span.set_attribute( + SpanAttributes.LLM_REQUEST_MAX_TOKENS, + kwargs.get("max_tokens"), + ) + if "temperature" in optional_params: + span.set_attribute( + SpanAttributes.LLM_REQUEST_TEMPERATURE, + kwargs.get("temperature"), ) - usage = response_obj.get("usage") - if usage: - span.set_attribute( - SpanAttributes.LLM_USAGE_TOTAL_TOKENS, - usage.get("total_tokens"), - ) - span.set_attribute( - SpanAttributes.LLM_USAGE_COMPLETION_TOKENS, - usage.get("completion_tokens"), - ) - span.set_attribute( - SpanAttributes.LLM_USAGE_PROMPT_TOKENS, - usage.get("prompt_tokens"), - ) - for idx, choice in enumerate(response_obj.get("choices")): - span.set_attribute( - f"{SpanAttributes.LLM_COMPLETIONS}.{idx}.finish_reason", - choice.get("finish_reason"), - ) - span.set_attribute( - f"{SpanAttributes.LLM_COMPLETIONS}.{idx}.role", - choice.get("message").get("role"), - ) - span.set_attribute( - f"{SpanAttributes.LLM_COMPLETIONS}.{idx}.content", - choice.get("message").get("content"), - ) + for idx, prompt in enumerate(kwargs.get("messages")): + span.set_attribute( + f"{SpanAttributes.LLM_PROMPTS}.{idx}.role", + prompt.get("role"), + ) + span.set_attribute( + f"{SpanAttributes.LLM_PROMPTS}.{idx}.content", + prompt.get("content"), + ) + + span.set_attribute( + SpanAttributes.LLM_RESPONSE_MODEL, response_obj.get("model") + ) + usage = response_obj.get("usage") + if usage: + span.set_attribute( + SpanAttributes.LLM_USAGE_TOTAL_TOKENS, + usage.get("total_tokens"), + ) + span.set_attribute( + SpanAttributes.LLM_USAGE_COMPLETION_TOKENS, + usage.get("completion_tokens"), + ) + span.set_attribute( + SpanAttributes.LLM_USAGE_PROMPT_TOKENS, + usage.get("prompt_tokens"), + ) + + for idx, choice in enumerate(response_obj.get("choices")): + span.set_attribute( + f"{SpanAttributes.LLM_COMPLETIONS}.{idx}.finish_reason", + choice.get("finish_reason"), + ) + span.set_attribute( + f"{SpanAttributes.LLM_COMPLETIONS}.{idx}.role", + choice.get("message").get("role"), + ) + span.set_attribute( + f"{SpanAttributes.LLM_COMPLETIONS}.{idx}.content", + choice.get("message").get("content"), + ) + + if ( + level == "ERROR" + and status_message is not None + and isinstance(status_message, str) + ): + span.record_exception(Exception(status_message)) + span.set_status(Status(StatusCode.ERROR, status_message)) + + span.end(end_time) except Exception as e: print_verbose(f"Traceloop Layer Error - {e}") diff --git a/litellm/tests/test_traceloop.py b/litellm/tests/test_traceloop.py index 405a8a3574..f969736285 100644 --- a/litellm/tests/test_traceloop.py +++ b/litellm/tests/test_traceloop.py @@ -1,49 +1,35 @@ -# Commented out for now - since traceloop break ci/cd -# import sys -# import os -# import io, asyncio +import sys +import os +import time +import pytest +import litellm +from opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter +from traceloop.sdk import Traceloop -# sys.path.insert(0, os.path.abspath('../..')) - -# from litellm import completion -# import litellm -# litellm.num_retries = 3 -# litellm.success_callback = [""] -# import time -# import pytest -# from traceloop.sdk import Traceloop -# Traceloop.init(app_name="test-litellm", disable_batch=True) +sys.path.insert(0, os.path.abspath("../..")) -# def test_traceloop_logging(): -# try: -# litellm.set_verbose = True -# response = litellm.completion( -# model="gpt-3.5-turbo", -# messages=[{"role": "user", "content":"This is a test"}], -# max_tokens=1000, -# temperature=0.7, -# timeout=5, -# ) -# print(f"response: {response}") -# except Exception as e: -# pytest.fail(f"An exception occurred - {e}") -# # test_traceloop_logging() +@pytest.fixture() +def exporter(): + exporter = InMemorySpanExporter() + Traceloop.init( + app_name="test_litellm", + disable_batch=True, + exporter=exporter, + ) + litellm.success_callback = ["traceloop"] + litellm.set_verbose = True + + return exporter -# # def test_traceloop_logging_async(): -# # try: -# # litellm.set_verbose = True -# # async def test_acompletion(): -# # return await litellm.acompletion( -# # model="gpt-3.5-turbo", -# # messages=[{"role": "user", "content":"This is a test"}], -# # max_tokens=1000, -# # temperature=0.7, -# # timeout=5, -# # ) -# # response = asyncio.run(test_acompletion()) -# # print(f"response: {response}") -# # except Exception as e: -# # pytest.fail(f"An exception occurred - {e}") -# # test_traceloop_logging_async() +@pytest.mark.parametrize("model", ["claude-instant-1.2", "gpt-3.5-turbo"]) +def test_traceloop_logging(exporter, model): + + litellm.completion( + model=model, + messages=[{"role": "user", "content": "This is a test"}], + max_tokens=1000, + temperature=0.7, + timeout=5, + ) diff --git a/litellm/utils.py b/litellm/utils.py index ea0f46c144..95d9160efa 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -2027,6 +2027,7 @@ class Logging: response_obj=result, start_time=start_time, end_time=end_time, + user_id=kwargs.get("user", None), print_verbose=print_verbose, ) if callback == "s3": @@ -2598,6 +2599,17 @@ class Logging: level="ERROR", kwargs=self.model_call_details, ) + if callback == "traceloop": + traceloopLogger.log_event( + start_time=start_time, + end_time=end_time, + response_obj=None, + user_id=kwargs.get("user", None), + print_verbose=print_verbose, + status_message=str(exception), + level="ERROR", + kwargs=self.model_call_details, + ) if callback == "prometheus": global prometheusLogger verbose_logger.debug("reaches prometheus for success logging!") From 67f1f374ecfe5b784b56ecaeebe1b35cc73c79f7 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 29 May 2024 18:10:45 -0700 Subject: [PATCH 083/136] fix comment --- litellm/integrations/langfuse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/integrations/langfuse.py b/litellm/integrations/langfuse.py index d1e8763c08..977db62d31 100644 --- a/litellm/integrations/langfuse.py +++ b/litellm/integrations/langfuse.py @@ -455,7 +455,7 @@ class LangFuseLogger: } generation_name = clean_metadata.pop("generation_name", None) if generation_name is None: - # if `generation_name` is None, use sensible default values for generation_name + # if `generation_name` is None, use sensible default values # If using litellm proxy user `key_alias` if not None # If `key_alias` is None, just log `litellm-{call_type}` as the generation name _user_api_key_alias = clean_metadata.get("user_api_key_alias", None) From 4a9d942655c0cd9d5eb1dd1ba5e6cd15afebec57 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 29 May 2024 18:36:34 -0700 Subject: [PATCH 084/136] ui - fix bug --- ui/litellm-dashboard/src/components/model_dashboard.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/litellm-dashboard/src/components/model_dashboard.tsx b/ui/litellm-dashboard/src/components/model_dashboard.tsx index 562276fe56..66e0bd6340 100644 --- a/ui/litellm-dashboard/src/components/model_dashboard.tsx +++ b/ui/litellm-dashboard/src/components/model_dashboard.tsx @@ -1790,7 +1790,6 @@ const ModelDashboard: React.FC = ({ index="model" categories={allExceptions} stack={true} - colors={["indigo-300", "rose-200", "#ffcc33"]} yAxisWidth={30} /> From 8c6a19d3abbe00a47b2db0bd8662a5e4380cc782 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 29 May 2024 18:40:53 -0700 Subject: [PATCH 085/136] fix put litellm prefix in generation name --- litellm/integrations/langfuse.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/litellm/integrations/langfuse.py b/litellm/integrations/langfuse.py index 977db62d31..12b20f3d31 100644 --- a/litellm/integrations/langfuse.py +++ b/litellm/integrations/langfuse.py @@ -459,10 +459,9 @@ class LangFuseLogger: # If using litellm proxy user `key_alias` if not None # If `key_alias` is None, just log `litellm-{call_type}` as the generation name _user_api_key_alias = clean_metadata.get("user_api_key_alias", None) - generation_name = ( - _user_api_key_alias - or f"litellm-{kwargs.get('call_type', 'completion')}" - ) + generation_name = f"litellm-{kwargs.get('call_type', 'completion')}" + if _user_api_key_alias is not None: + generation_name = f"litellm:{_user_api_key_alias}" if response_obj is not None and "system_fingerprint" in response_obj: system_fingerprint = response_obj.get("system_fingerprint", None) From c39db5686dfa1fa7d59a4c84eafc04714ce33d71 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 29 May 2024 18:49:19 -0700 Subject: [PATCH 086/136] ui - new build --- litellm/proxy/_experimental/out/{404/index.html => 404.html} | 2 +- .../_buildManifest.js | 0 .../_ssgManifest.js | 0 .../out/_next/static/chunks/app/page-0f6ae871c63eb14b.js | 1 - .../out/_next/static/chunks/app/page-1fb033a77b428a50.js | 1 + litellm/proxy/_experimental/out/index.html | 2 +- litellm/proxy/_experimental/out/index.txt | 4 ++-- .../out/{model_hub/index.html => model_hub.html} | 2 +- litellm/proxy/_experimental/out/model_hub.txt | 2 +- ui/litellm-dashboard/out/404.html | 2 +- .../_buildManifest.js | 0 .../_ssgManifest.js | 0 .../out/_next/static/chunks/app/page-0f6ae871c63eb14b.js | 1 - .../out/_next/static/chunks/app/page-1fb033a77b428a50.js | 1 + ui/litellm-dashboard/out/index.html | 2 +- ui/litellm-dashboard/out/index.txt | 4 ++-- ui/litellm-dashboard/out/model_hub.html | 2 +- ui/litellm-dashboard/out/model_hub.txt | 2 +- ui/litellm-dashboard/src/components/edit_user.tsx | 4 ---- ui/litellm-dashboard/src/components/usage.tsx | 2 +- 20 files changed, 15 insertions(+), 19 deletions(-) rename litellm/proxy/_experimental/out/{404/index.html => 404.html} (98%) rename litellm/proxy/_experimental/out/_next/static/{XsAEnZvT8GWmMEp4_0in- => QpcxqKJjVnif9CYPhpWjb}/_buildManifest.js (100%) rename litellm/proxy/_experimental/out/_next/static/{XsAEnZvT8GWmMEp4_0in- => QpcxqKJjVnif9CYPhpWjb}/_ssgManifest.js (100%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/page-0f6ae871c63eb14b.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/page-1fb033a77b428a50.js rename litellm/proxy/_experimental/out/{model_hub/index.html => model_hub.html} (98%) rename ui/litellm-dashboard/out/_next/static/{XsAEnZvT8GWmMEp4_0in- => QpcxqKJjVnif9CYPhpWjb}/_buildManifest.js (100%) rename ui/litellm-dashboard/out/_next/static/{XsAEnZvT8GWmMEp4_0in- => QpcxqKJjVnif9CYPhpWjb}/_ssgManifest.js (100%) delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/page-0f6ae871c63eb14b.js create mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/page-1fb033a77b428a50.js diff --git a/litellm/proxy/_experimental/out/404/index.html b/litellm/proxy/_experimental/out/404.html similarity index 98% rename from litellm/proxy/_experimental/out/404/index.html rename to litellm/proxy/_experimental/out/404.html index daae71ba32..2c4f52e83c 100644 --- a/litellm/proxy/_experimental/out/404/index.html +++ b/litellm/proxy/_experimental/out/404.html @@ -1 +1 @@ -404: This page could not be found.LiteLLM Dashboard

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.LiteLLM Dashboard

404

This page could not be found.

\ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/XsAEnZvT8GWmMEp4_0in-/_buildManifest.js b/litellm/proxy/_experimental/out/_next/static/QpcxqKJjVnif9CYPhpWjb/_buildManifest.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/XsAEnZvT8GWmMEp4_0in-/_buildManifest.js rename to litellm/proxy/_experimental/out/_next/static/QpcxqKJjVnif9CYPhpWjb/_buildManifest.js diff --git a/litellm/proxy/_experimental/out/_next/static/XsAEnZvT8GWmMEp4_0in-/_ssgManifest.js b/litellm/proxy/_experimental/out/_next/static/QpcxqKJjVnif9CYPhpWjb/_ssgManifest.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/XsAEnZvT8GWmMEp4_0in-/_ssgManifest.js rename to litellm/proxy/_experimental/out/_next/static/QpcxqKJjVnif9CYPhpWjb/_ssgManifest.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/page-0f6ae871c63eb14b.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/page-0f6ae871c63eb14b.js deleted file mode 100644 index 5e1fb3b33d..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/page-0f6ae871c63eb14b.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{20661:function(e,l,s){Promise.resolve().then(s.bind(s,62631))},62631:function(e,l,s){"use strict";s.r(l),s.d(l,{default:function(){return e9}});var t,n,a=s(3827),r=s(64090),i=s(47907),o=s(8792),d=s(40491),c=s(65270),m=e=>{let{userID:l,userRole:s,userEmail:t,showSSOBanner:n,premiumUser:r}=e;console.log("User ID:",l),console.log("userEmail:",t),console.log("showSSOBanner:",n),console.log("premiumUser:",r);let i=[{key:"1",label:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("p",{children:["Role: ",s]}),(0,a.jsxs)("p",{children:["ID: ",l]}),(0,a.jsxs)("p",{children:["Premium User: ",String(r)]})]})}];return(0,a.jsxs)("nav",{className:"left-0 right-0 top-0 flex justify-between items-center h-12 mb-4",children:[(0,a.jsx)("div",{className:"text-left my-2 absolute top-0 left-0",children:(0,a.jsx)("div",{className:"flex flex-col items-center",children:(0,a.jsx)(o.default,{href:"/",children:(0,a.jsx)("button",{className:"text-gray-800 rounded text-center",children:(0,a.jsx)("img",{src:"/get_image",width:160,height:160,alt:"LiteLLM Brand",className:"mr-2"})})})})}),(0,a.jsxs)("div",{className:"text-right mx-4 my-2 absolute top-0 right-0 flex items-center justify-end space-x-2",children:[n?(0,a.jsx)("div",{style:{padding:"6px",borderRadius:"8px"},children:(0,a.jsx)("a",{href:"https://calendly.com/d/4mp-gd3-k5k/litellm-1-1-onboarding-chat",target:"_blank",style:{fontSize:"14px",textDecoration:"underline"},children:"Get enterpise license"})}):null,(0,a.jsx)("div",{style:{border:"1px solid #391085",padding:"6px",borderRadius:"8px"},children:(0,a.jsx)(d.Z,{menu:{items:i},children:(0,a.jsx)(c.Z,{children:t})})})]})]})},u=s(777),h=s(10384),x=s(46453),p=s(16450),j=s(52273),g=s(26780),Z=s(15595),f=s(6698),_=s(71801),y=s(42440),b=s(42308),v=s(50670),S=s(81583),k=s(80588),w=s(99129),N=s(44839),A=s(88707),I=s(1861);let{Option:C}=v.default;var E=e=>{let{userID:l,team:s,userRole:t,accessToken:n,data:i,setData:o}=e,[d]=S.Z.useForm(),[c,m]=(0,r.useState)(!1),[E,P]=(0,r.useState)(null),[T,O]=(0,r.useState)(null),[R,F]=(0,r.useState)([]),[M,L]=(0,r.useState)([]),U=()=>{m(!1),d.resetFields()},D=()=>{m(!1),P(null),d.resetFields()};(0,r.useEffect)(()=>{(async()=>{try{if(null===l||null===t)return;if(null!==n){let e=(await (0,u.So)(n,l,t)).data.map(e=>e.id);console.log("available_model_names:",e),F(e)}}catch(e){console.error("Error fetching user models:",e)}})()},[n,l,t]);let K=async e=>{try{var s,t,a;let r=null!==(s=null==e?void 0:e.key_alias)&&void 0!==s?s:"",c=null!==(t=null==e?void 0:e.team_id)&&void 0!==t?t:null;if((null!==(a=null==i?void 0:i.filter(e=>e.team_id===c).map(e=>e.key_alias))&&void 0!==a?a:[]).includes(r))throw Error("Key alias ".concat(r," already exists for team with ID ").concat(c,", please provide another key alias"));k.ZP.info("Making API Call"),m(!0);let h=await (0,u.wX)(n,l,e);console.log("key create Response:",h),o(e=>e?[...e,h]:[h]),P(h.key),O(h.soft_budget),k.ZP.success("API Key Created"),d.resetFields(),localStorage.removeItem("userData"+l)}catch(e){console.error("Error creating the key:",e),k.ZP.error("Error creating the key: ".concat(e),20)}};return(0,r.useEffect)(()=>{L(s&&s.models.length>0?s.models.includes("all-proxy-models")?R:s.models:R)},[s,R]),(0,a.jsxs)("div",{children:[(0,a.jsx)(p.Z,{className:"mx-auto",onClick:()=>m(!0),children:"+ Create New Key"}),(0,a.jsx)(w.Z,{title:"Create Key",visible:c,width:800,footer:null,onOk:U,onCancel:D,children:(0,a.jsxs)(S.Z,{form:d,onFinish:K,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Key Name",name:"key_alias",rules:[{required:!0,message:"Please input a key name"}],help:"required",children:(0,a.jsx)(j.Z,{placeholder:""})}),(0,a.jsx)(S.Z.Item,{label:"Team ID",name:"team_id",hidden:!0,initialValue:s?s.team_id:null,valuePropName:"team_id",className:"mt-8",children:(0,a.jsx)(N.Z,{value:s?s.team_alias:"",disabled:!0})}),(0,a.jsx)(S.Z.Item,{label:"Models",name:"models",rules:[{required:!0,message:"Please select a model"}],help:"required",children:(0,a.jsxs)(v.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},onChange:e=>{e.includes("all-team-models")&&d.setFieldsValue({models:["all-team-models"]})},children:[(0,a.jsx)(C,{value:"all-team-models",children:"All Team Models"},"all-team-models"),M.map(e=>(0,a.jsx)(C,{value:e,children:e},e))]})}),(0,a.jsxs)(g.Z,{className:"mt-20 mb-8",children:[(0,a.jsx)(f.Z,{children:(0,a.jsx)("b",{children:"Optional Settings"})}),(0,a.jsxs)(Z.Z,{children:[(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Max Budget (USD)",name:"max_budget",help:"Budget cannot exceed team max budget: $".concat((null==s?void 0:s.max_budget)!==null&&(null==s?void 0:s.max_budget)!==void 0?null==s?void 0:s.max_budget:"unlimited"),rules:[{validator:async(e,l)=>{if(l&&s&&null!==s.max_budget&&l>s.max_budget)throw Error("Budget cannot exceed team max budget: $".concat(s.max_budget))}}],children:(0,a.jsx)(A.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",help:"Team Reset Budget: ".concat((null==s?void 0:s.budget_duration)!==null&&(null==s?void 0:s.budget_duration)!==void 0?null==s?void 0:s.budget_duration:"None"),children:(0,a.jsxs)(v.default,{defaultValue:null,placeholder:"n/a",children:[(0,a.jsx)(v.default.Option,{value:"24h",children:"daily"}),(0,a.jsx)(v.default.Option,{value:"30d",children:"monthly"})]})}),(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Tokens per minute Limit (TPM)",name:"tpm_limit",help:"TPM cannot exceed team TPM limit: ".concat((null==s?void 0:s.tpm_limit)!==null&&(null==s?void 0:s.tpm_limit)!==void 0?null==s?void 0:s.tpm_limit:"unlimited"),rules:[{validator:async(e,l)=>{if(l&&s&&null!==s.tpm_limit&&l>s.tpm_limit)throw Error("TPM limit cannot exceed team TPM limit: ".concat(s.tpm_limit))}}],children:(0,a.jsx)(A.Z,{step:1,width:400})}),(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Requests per minute Limit (RPM)",name:"rpm_limit",help:"RPM cannot exceed team RPM limit: ".concat((null==s?void 0:s.rpm_limit)!==null&&(null==s?void 0:s.rpm_limit)!==void 0?null==s?void 0:s.rpm_limit:"unlimited"),rules:[{validator:async(e,l)=>{if(l&&s&&null!==s.rpm_limit&&l>s.rpm_limit)throw Error("RPM limit cannot exceed team RPM limit: ".concat(s.rpm_limit))}}],children:(0,a.jsx)(A.Z,{step:1,width:400})}),(0,a.jsx)(S.Z.Item,{label:"Expire Key (eg: 30s, 30h, 30d)",name:"duration",className:"mt-8",children:(0,a.jsx)(j.Z,{placeholder:""})}),(0,a.jsx)(S.Z.Item,{label:"Metadata",name:"metadata",className:"mt-8",children:(0,a.jsx)(N.Z.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})})]})]})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Create Key"})})]})}),E&&(0,a.jsx)(w.Z,{visible:c,onOk:U,onCancel:D,footer:null,children:(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 w-full",children:[(0,a.jsx)(y.Z,{children:"Save your Key"}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)("p",{children:["Please save this secret key somewhere safe and accessible. For security reasons, ",(0,a.jsx)("b",{children:"you will not be able to view it again"})," ","through your LiteLLM account. If you lose this secret key, you will need to generate a new one."]})}),(0,a.jsx)(h.Z,{numColSpan:1,children:null!=E?(0,a.jsxs)("div",{children:[(0,a.jsx)(_.Z,{className:"mt-3",children:"API Key:"}),(0,a.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,a.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:E})}),(0,a.jsx)(b.CopyToClipboard,{text:E,onCopy:()=>{k.ZP.success("API Key copied to clipboard")},children:(0,a.jsx)(p.Z,{className:"mt-3",children:"Copy API Key"})})]}):(0,a.jsx)(_.Z,{children:"Key being created, this might take 30s"})})]})})]})},P=s(9454),T=s(98941),O=s(33393),R=s(5),F=s(13810),M=s(61244),L=s(10827),U=s(3851),D=s(2044),K=s(64167),B=s(74480),q=s(7178),z=s(95093),V=s(27166);let{Option:G}=v.default;var W=e=>{let{userID:l,userRole:s,accessToken:t,selectedTeam:n,data:i,setData:o,teams:d}=e,[c,m]=(0,r.useState)(!1),[h,x]=(0,r.useState)(!1),[j,g]=(0,r.useState)(null),[Z,f]=(0,r.useState)(null),[b,C]=(0,r.useState)(null),[E,W]=(0,r.useState)(""),[H,Y]=(0,r.useState)(!1),[J,$]=(0,r.useState)(!1),[X,Q]=(0,r.useState)(null),[ee,el]=(0,r.useState)([]),es=new Set,[et,en]=(0,r.useState)(es);(0,r.useEffect)(()=>{(async()=>{try{if(null===l)return;if(null!==t&&null!==s){let e=(await (0,u.So)(t,l,s)).data.map(e=>e.id);console.log("available_model_names:",e),el(e)}}catch(e){console.error("Error fetching user models:",e)}})()},[t,l,s]),(0,r.useEffect)(()=>{if(d){let e=new Set;d.forEach((l,s)=>{let t=l.team_id;e.add(t)}),en(e)}},[d]);let ea=e=>{console.log("handleEditClick:",e),null==e.token&&null!==e.token_id&&(e.token=e.token_id),Q(e),Y(!0)},er=async e=>{if(null==t)return;let l=e.token;e.key=l,console.log("handleEditSubmit:",e);let s=await (0,u.Nc)(t,e);console.log("handleEditSubmit: newKeyValues",s),i&&o(i.map(e=>e.token===l?s:e)),k.ZP.success("Key updated successfully"),Y(!1),Q(null)},ei=async e=>{console.log("handleDelete:",e),null==e.token&&null!==e.token_id&&(e.token=e.token_id),null!=i&&(g(e.token),localStorage.removeItem("userData"+l),x(!0))},eo=async()=>{if(null!=j&&null!=i){try{await (0,u.I1)(t,j);let e=i.filter(e=>e.token!==j);o(e)}catch(e){console.error("Error deleting the key:",e)}x(!1),g(null)}};if(null!=i)return console.log("RERENDER TRIGGERED"),(0,a.jsxs)("div",{children:[(0,a.jsxs)(F.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh] mb-4 mt-2",children:[(0,a.jsxs)(L.Z,{className:"mt-5 max-h-[300px] min-h-[300px]",children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Key Alias"}),(0,a.jsx)(B.Z,{children:"Secret Key"}),(0,a.jsx)(B.Z,{children:"Spend (USD)"}),(0,a.jsx)(B.Z,{children:"Budget (USD)"}),(0,a.jsx)(B.Z,{children:"Models"}),(0,a.jsx)(B.Z,{children:"TPM / RPM Limits"})]})}),(0,a.jsx)(U.Z,{children:i.map(e=>{if(console.log(e),"litellm-dashboard"===e.team_id)return null;if(n){if(console.log("item team id: ".concat(e.team_id,", knownTeamIDs.has(item.team_id): ").concat(et.has(e.team_id),", selectedTeam id: ").concat(n.team_id)),(null!=n.team_id||null===e.team_id||et.has(e.team_id))&&e.team_id!=n.team_id)return null;console.log("item team id: ".concat(e.team_id,", is returned"))}return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{style:{maxWidth:"2px",whiteSpace:"pre-wrap",overflow:"hidden"},children:null!=e.key_alias?(0,a.jsx)(_.Z,{children:e.key_alias}):(0,a.jsx)(_.Z,{children:"Not Set"})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(_.Z,{children:e.key_name})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(_.Z,{children:(()=>{try{return parseFloat(e.spend).toFixed(4)}catch(l){return e.spend}})()})}),(0,a.jsx)(D.Z,{children:null!=e.max_budget?(0,a.jsx)(_.Z,{children:e.max_budget}):(0,a.jsx)(_.Z,{children:"Unlimited"})}),(0,a.jsx)(D.Z,{children:Array.isArray(e.models)?(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:0===e.models.length?(0,a.jsx)(a.Fragment,{children:n&&n.models&&n.models.length>0?n.models.map((e,l)=>"all-proxy-models"===e?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Proxy Models"})},l):"all-team-models"===e?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Team Models"})},l):(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,a.jsx)(_.Z,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},l)):(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,a.jsx)(_.Z,{children:"all-proxy-models"})})}):e.models.map((e,l)=>"all-proxy-models"===e?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Proxy Models"})},l):"all-team-models"===e?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Team Models"})},l):(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,a.jsx)(_.Z,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},l))}):null}),(0,a.jsx)(D.Z,{children:(0,a.jsxs)(_.Z,{children:["TPM: ",e.tpm_limit?e.tpm_limit:"Unlimited"," ",(0,a.jsx)("br",{})," RPM:"," ",e.rpm_limit?e.rpm_limit:"Unlimited"]})}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(M.Z,{onClick:()=>{Q(e),$(!0)},icon:P.Z,size:"sm"}),(0,a.jsx)(w.Z,{open:J,onCancel:()=>{$(!1),Q(null)},footer:null,width:800,children:X&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3 mt-8",children:[(0,a.jsxs)(F.Z,{children:[(0,a.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Spend"}),(0,a.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,a.jsx)("p",{className:"text-tremor font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:(()=>{try{return parseFloat(X.spend).toFixed(4)}catch(e){return X.spend}})()})})]}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Budget"}),(0,a.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,a.jsx)("p",{className:"text-tremor font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:null!=X.max_budget?(0,a.jsx)(a.Fragment,{children:X.max_budget}):(0,a.jsx)(a.Fragment,{children:"Unlimited"})})})]},e.name),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Expires"}),(0,a.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,a.jsx)("p",{className:"text-tremor-default font-small text-tremor-content-strong dark:text-dark-tremor-content-strong",children:null!=X.expires?(0,a.jsx)(a.Fragment,{children:new Date(X.expires).toLocaleString(void 0,{day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})}):(0,a.jsx)(a.Fragment,{children:"Never"})})})]},e.name)]}),(0,a.jsxs)(F.Z,{className:"my-4",children:[(0,a.jsx)(y.Z,{children:"Token Name"}),(0,a.jsx)(_.Z,{className:"my-1",children:X.key_alias?X.key_alias:X.key_name}),(0,a.jsx)(y.Z,{children:"Token ID"}),(0,a.jsx)(_.Z,{className:"my-1 text-[12px]",children:X.token}),(0,a.jsx)(y.Z,{children:"Metadata"}),(0,a.jsx)(_.Z,{className:"my-1",children:(0,a.jsxs)("pre",{children:[JSON.stringify(X.metadata)," "]})})]}),(0,a.jsx)(p.Z,{className:"mx-auto flex items-center",onClick:()=>{$(!1),Q(null)},children:"Close"})]})}),(0,a.jsx)(M.Z,{icon:T.Z,size:"sm",onClick:()=>ea(e)}),(0,a.jsx)(M.Z,{onClick:()=>ei(e),icon:O.Z,size:"sm"})]})]},e.token)})})]}),h&&(0,a.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,a.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,a.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,a.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,a.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,a.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,a.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,a.jsx)("div",{className:"sm:flex sm:items-start",children:(0,a.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,a.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Key"}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this key ?"})})]})})}),(0,a.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,a.jsx)(p.Z,{onClick:eo,color:"red",className:"ml-2",children:"Delete"}),(0,a.jsx)(p.Z,{onClick:()=>{x(!1),g(null)},children:"Cancel"})]})]})]})})]}),X&&(0,a.jsx)(e=>{let{visible:l,onCancel:s,token:t,onSubmit:i}=e,[o]=S.Z.useForm(),[c,m]=(0,r.useState)(n),[u,h]=(0,r.useState)([]),[x,p]=(0,r.useState)(!1);return(0,a.jsx)(w.Z,{title:"Edit Key",visible:l,width:800,footer:null,onOk:()=>{o.validateFields().then(e=>{o.resetFields()}).catch(e=>{console.error("Validation failed:",e)})},onCancel:s,children:(0,a.jsxs)(S.Z,{form:o,onFinish:er,initialValues:t,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Key Name",name:"key_alias",rules:[{required:!0,message:"Please input a key name"}],help:"required",children:(0,a.jsx)(N.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"Models",name:"models",rules:[{validator:(e,l)=>{let s=l.filter(e=>!c.models.includes(e)&&"all-team-models"!==e&&"all-proxy-models"!==e&&!c.models.includes("all-proxy-models"));return(console.log("errorModels: ".concat(s)),s.length>0)?Promise.reject("Some models are not part of the new team's models - ".concat(s,"Team models: ").concat(c.models)):Promise.resolve()}}],children:(0,a.jsxs)(v.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,a.jsx)(G,{value:"all-team-models",children:"All Team Models"},"all-team-models"),c&&c.models?c.models.includes("all-proxy-models")?ee.filter(e=>"all-proxy-models"!==e).map(e=>(0,a.jsx)(G,{value:e,children:e},e)):c.models.map(e=>(0,a.jsx)(G,{value:e,children:e},e)):ee.map(e=>(0,a.jsx)(G,{value:e,children:e},e))]})}),(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Max Budget (USD)",name:"max_budget",help:"Budget cannot exceed team max budget: ".concat((null==c?void 0:c.max_budget)!==null&&(null==c?void 0:c.max_budget)!==void 0?null==c?void 0:c.max_budget:"unlimited"),rules:[{validator:async(e,l)=>{if(l&&c&&null!==c.max_budget&&l>c.max_budget)throw console.log("keyTeam.max_budget: ".concat(c.max_budget)),Error("Budget cannot exceed team max budget: $".concat(c.max_budget))}}],children:(0,a.jsx)(A.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{label:"token",name:"token",hidden:!0}),(0,a.jsx)(S.Z.Item,{label:"Team",name:"team_id",help:"the team this key belongs to",children:(0,a.jsx)(z.Z,{value:t.team_alias,children:null==d?void 0:d.map((e,l)=>(0,a.jsx)(V.Z,{value:e.team_id,onClick:()=>m(e),children:e.team_alias},l))})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Edit Key"})})]})})},{visible:H,onCancel:()=>{Y(!1),Q(null)},token:X,onSubmit:er})]})},H=s(76032),Y=s(35152),J=e=>{let{userID:l,userRole:s,accessToken:t,userSpend:n,selectedTeam:i}=e;console.log("userSpend: ".concat(n));let[o,d]=(0,r.useState)(null!==n?n:0),[c,m]=(0,r.useState)(0),[h,x]=(0,r.useState)([]);(0,r.useEffect)(()=>{let e=async()=>{if(t&&l&&s&&"Admin"===s&&null==n)try{let e=await (0,u.Qy)(t);e&&(e.spend?d(e.spend):d(0),e.max_budget?m(e.max_budget):m(0))}catch(e){console.error("Error fetching global spend data:",e)}};(async()=>{try{if(null===l||null===s)return;if(null!==t){let e=(await (0,u.So)(t,l,s)).data.map(e=>e.id);console.log("available_model_names:",e),x(e)}}catch(e){console.error("Error fetching user models:",e)}})(),e()},[s,t,l]),(0,r.useEffect)(()=>{null!==n&&d(n)},[n]);let p=[];i&&i.models&&(p=i.models),p&&p.includes("all-proxy-models")?(console.log("user models:",h),p=h):p&&p.includes("all-team-models")?p=i.models:p&&0===p.length&&(p=h);let j=void 0!==o?o.toFixed(4):null;return console.log("spend in view user spend: ".concat(o)),(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("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:["$",j]})]}),(0,a.jsx)("div",{className:"ml-auto",children:(0,a.jsxs)(g.Z,{children:[(0,a.jsx)(f.Z,{children:(0,a.jsx)(_.Z,{children:"Team Models"})}),(0,a.jsx)(Z.Z,{className:"absolute right-0 z-10 bg-white p-2 shadow-lg max-w-xs",children:(0,a.jsx)(H.Z,{children:p.map(e=>(0,a.jsx)(Y.Z,{children:(0,a.jsx)(_.Z,{children:e})},e))})})]})})]})},$=e=>{let{userID:l,userRole:s,selectedTeam:t,accessToken:n}=e,[i,o]=(0,r.useState)([]);(0,r.useEffect)(()=>{(async()=>{try{if(null===l||null===s)return;if(null!==n){let e=(await (0,u.So)(n,l,s)).data.map(e=>e.id);console.log("available_model_names:",e),o(e)}}catch(e){console.error("Error fetching user models:",e)}})()},[n,l,s]);let d=[];return t&&t.models&&(d=t.models),d&&d.includes("all-proxy-models")&&(console.log("user models:",i),d=i),(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"mb-5",children:(0,a.jsx)("p",{className:"text-3xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:null==t?void 0:t.team_alias})})})},X=e=>{let l,{teams:s,setSelectedTeam:t,userRole:n}=e,i={models:[],team_id:null,team_alias:"Default Team"},[o,d]=(0,r.useState)(i);return(l="App User"===n?s:s?[...s,i]:[i],"App User"===n)?null:(0,a.jsxs)("div",{className:"mt-5 mb-5",children:[(0,a.jsx)(y.Z,{children:"Select Team"}),(0,a.jsx)(_.Z,{children:"If you belong to multiple teams, this setting controls which team is used by default when creating new API Keys."}),(0,a.jsxs)(_.Z,{className:"mt-3 mb-3",children:[(0,a.jsx)("b",{children:"Default Team:"})," If no team_id is set for a key, it will be grouped under here."]}),l&&l.length>0?(0,a.jsx)(z.Z,{defaultValue:"0",children:l.map((e,l)=>(0,a.jsx)(V.Z,{value:String(l),onClick:()=>t(e),children:e.team_alias},l))}):(0,a.jsxs)(_.Z,{children:["No team created. ",(0,a.jsx)("b",{children:"Defaulting to personal account."})]})]})},Q=s(37963),ee=s(97482);console.log("isLocal:",!1);var el=e=>{let{userID:l,userRole:s,teams:t,keys:n,setUserRole:o,userEmail:d,setUserEmail:c,setTeams:m,setKeys:p}=e,[j,g]=(0,r.useState)(null),Z=(0,i.useSearchParams)();Z.get("viewSpend"),(0,i.useRouter)();let f=Z.get("token"),[_,y]=(0,r.useState)(null),[b,v]=(0,r.useState)(null),[S,k]=(0,r.useState)([]),w={models:[],team_alias:"Default Team",team_id:null},[N,A]=(0,r.useState)(t?t[0]:w);if(window.addEventListener("beforeunload",function(){sessionStorage.clear()}),(0,r.useEffect)(()=>{if(f){let e=(0,Q.o)(f);if(e){if(console.log("Decoded token:",e),console.log("Decoded key:",e.key),y(e.key),e.user_role){let l=function(e){if(!e)return"Undefined Role";switch(console.log("Received user role: ".concat(e)),e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(e.user_role);console.log("Decoded user_role:",l),o(l)}else console.log("User role not defined");e.user_email?c(e.user_email):console.log("User Email is not set ".concat(e))}}if(l&&_&&s&&!n&&!j){let e=sessionStorage.getItem("userModels"+l);e?k(JSON.parse(e)):(async()=>{try{let e=await (0,u.Br)(_,l,s,!1,null,null);if(console.log("received teams in user dashboard: ".concat(Object.keys(e),"; team values: ").concat(Object.entries(e.teams))),"Admin"==s){let e=await (0,u.Qy)(_);g(e),console.log("globalSpend:",e)}else g(e.user_info);p(e.keys),m(e.teams);let t=[...e.teams];t.length>0?(console.log("response['teams']: ".concat(t)),A(t[0])):A(w),sessionStorage.setItem("userData"+l,JSON.stringify(e.keys)),sessionStorage.setItem("userSpendData"+l,JSON.stringify(e.user_info));let n=(await (0,u.So)(_,l,s)).data.map(e=>e.id);console.log("available_model_names:",n),k(n),console.log("userModels:",S),sessionStorage.setItem("userModels"+l,JSON.stringify(n))}catch(e){console.error("There was an error fetching the data",e)}})()}},[l,f,_,n,s]),(0,r.useEffect)(()=>{if(null!==n&&null!=N&&null!==N.team_id){let e=0;for(let l of n)N.hasOwnProperty("team_id")&&null!==l.team_id&&l.team_id===N.team_id&&(e+=l.spend);v(e)}else if(null!==n){let e=0;for(let l of n)e+=l.spend;v(e)}},[N]),null==l||null==f){let e="/sso/key/generate";return console.log("Full URL:",e),window.location.href=e,null}if(null==_)return null;if(null==s&&o("App Owner"),s&&"Admin Viewer"==s){let{Title:e,Paragraph:l}=ee.default;return(0,a.jsxs)("div",{children:[(0,a.jsx)(e,{level:1,children:"Access Denied"}),(0,a.jsx)(l,{children:"Ask your proxy admin for access to create keys"})]})}return console.log("inside user dashboard, selected team",N),(0,a.jsx)("div",{className:"w-full mx-4",children:(0,a.jsx)(x.Z,{numItems:1,className:"gap-2 p-8 h-[75vh] w-full mt-2",children:(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)($,{userID:l,userRole:s,selectedTeam:N||null,accessToken:_}),(0,a.jsx)(J,{userID:l,userRole:s,accessToken:_,userSpend:b,selectedTeam:N||null}),(0,a.jsx)(W,{userID:l,userRole:s,accessToken:_,selectedTeam:N||null,data:n,setData:p,teams:t}),(0,a.jsx)(E,{userID:l,team:N||null,userRole:s,accessToken:_,data:n,setData:p},N?N.team_id:null),(0,a.jsx)(X,{teams:t,setSelectedTeam:A,userRole:s})]})})})},es=s(35087),et=s(92836),en=s(26734),ea=s(41608),er=s(32126),ei=s(23682),eo=s(47047),ed=s(76628),ec=s(25707),em=s(44041),eu=s(1460),eh=s(28683),ex=s(38302),ep=s(78578),ej=s(63954),eg=e=>{let{modelID:l,accessToken:s}=e,[t,n]=(0,r.useState)(!1),i=async()=>{try{k.ZP.info("Making API Call"),n(!0);let e=await (0,u.Og)(s,l);console.log("model delete Response:",e),k.ZP.success("Model ".concat(l," deleted successfully")),n(!1)}catch(e){console.error("Error deleting the model:",e)}};return(0,a.jsxs)("div",{children:[(0,a.jsx)(M.Z,{onClick:()=>n(!0),icon:O.Z,size:"sm"}),(0,a.jsx)(w.Z,{open:t,onOk:i,okType:"danger",onCancel:()=>n(!1),children:(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 w-full",children:[(0,a.jsx)(y.Z,{children:"Delete Model"}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsx)("p",{children:"Are you sure you want to delete this model? This action is irreversible."})}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)("p",{children:["Model ID: ",(0,a.jsx)("b",{children:l})]})})]})})]})},eZ=s(97766),ef=s(46495),e_=s(18190),ey=s(91118),eb=e=>{let{modelMetrics:l,modelMetricsCategories:s,customTooltip:t,premiumUser:n}=e;return n?(0,a.jsx)(ey.Z,{title:"Time to First token (s)",className:"h-72",data:l,index:"date",showLegend:!1,categories:s,colors:["indigo","rose"],connectNulls:!0,customTooltip:t}):(0,a.jsxs)("div",{children:[(0,a.jsx)(e_.Z,{title:"✨ Enterprise Feature",color:"teal",className:"mt-2 mb-4",children:"Enterprise features are available for users with a specific license, please contact LiteLLM to unlock this limitation."}),(0,a.jsx)(p.Z,{variant:"primary",children:(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get in touch"})})]})},ev=e=>{let{fields:l,selectedProvider:s}=e;return 0===l.length?null:(0,a.jsx)(a.Fragment,{children:l.map(e=>(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:e.field_name.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),name:e.field_name,tooltip:e.field_description,className:"mb-2",children:(0,a.jsx)(j.Z,{placeholder:e.field_value,type:"password"})},e.field_name))})},eS=s(67951);let{Title:ek,Link:ew}=ee.default;(t=n||(n={})).OpenAI="OpenAI",t.Azure="Azure",t.Anthropic="Anthropic",t.Google_AI_Studio="Google AI Studio",t.Bedrock="Amazon Bedrock",t.OpenAI_Compatible="OpenAI-Compatible Endpoints (Groq, Together AI, Mistral AI, etc.)",t.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",t.Databricks="Databricks";let eN={OpenAI:"openai",Azure:"azure",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",OpenAI_Compatible:"openai",Vertex_AI:"vertex_ai",Databricks:"databricks"},eA={"BadRequestError (400)":"BadRequestErrorRetries","AuthenticationError (401)":"AuthenticationErrorRetries","TimeoutError (408)":"TimeoutErrorRetries","RateLimitError (429)":"RateLimitErrorRetries","ContentPolicyViolationError (400)":"ContentPolicyViolationErrorRetries","InternalServerError (500)":"InternalServerErrorRetries"},eI=async(e,l,s)=>{try{let t=Array.isArray(e.model)?e.model:[e.model];console.log("received deployments: ".concat(t)),console.log("received type of deployments: ".concat(typeof t)),t.forEach(async s=>{console.log("litellm_model: ".concat(s));let t={},n={};t.model=s;let a="";for(let[l,s]of(console.log("formValues add deployment:",e),Object.entries(e)))if(""!==s){if("model_name"==l)a+=s;else if("custom_llm_provider"==l)continue;else if("model"==l)continue;else if("base_model"===l)n[l]=s;else if("litellm_extra_params"==l){console.log("litellm_extra_params:",s);let e={};if(s&&void 0!=s){try{e=JSON.parse(s)}catch(e){throw k.ZP.error("Failed to parse LiteLLM Extra Params: "+e,10),Error("Failed to parse litellm_extra_params: "+e)}for(let[l,s]of Object.entries(e))t[l]=s}}else t[l]=s}let r={model_name:a,litellm_params:t,model_info:n},i=await (0,u.kK)(l,r);console.log("response for model create call: ".concat(i.data))}),s.resetFields()}catch(e){k.ZP.error("Failed to create model: "+e,10)}};var eC=e=>{var l,s,t;let i,{accessToken:o,token:d,userRole:c,userID:m,modelData:h={data:[]},setModelData:g,premiumUser:Z}=e,[f,b]=(0,r.useState)([]),[v]=S.Z.useForm(),[N,C]=(0,r.useState)(null),[E,O]=(0,r.useState)(""),[G,W]=(0,r.useState)([]),H=Object.values(n).filter(e=>isNaN(Number(e))),[Y,J]=(0,r.useState)([]),[$,X]=(0,r.useState)("OpenAI"),[Q,el]=(0,r.useState)(""),[e_,ey]=(0,r.useState)(!1),[eC,eE]=(0,r.useState)(!1),[eP,eT]=(0,r.useState)(null),[eO,eR]=(0,r.useState)([]),[eF,eM]=(0,r.useState)(null),[eL,eU]=(0,r.useState)([]),[eD,eK]=(0,r.useState)([]),[eB,eq]=(0,r.useState)([]),[ez,eV]=(0,r.useState)([]),[eG,eW]=(0,r.useState)([]),[eH,eY]=(0,r.useState)([]),[eJ,e$]=(0,r.useState)([]),[eX,eQ]=(0,r.useState)([]),[e0,e1]=(0,r.useState)([]),[e2,e4]=(0,r.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[e5,e8]=(0,r.useState)(null),[e3,e6]=(0,r.useState)(0),e7=e=>{eT(e),ey(!0)},e9=e=>{eT(e),eE(!0)},le=async e=>{if(console.log("handleEditSubmit:",e),null==o)return;let l={},s=null;for(let[t,n]of Object.entries(e))"model_id"!==t?l[t]=n:s=n;let t={litellm_params:l,model_info:{id:s}};console.log("handleEditSubmit payload:",t);try{await (0,u.um)(o,t),k.ZP.success("Model updated successfully, restart server to see updates"),ey(!1),eT(null)}catch(e){console.log("Error occurred")}},ll=()=>{O(new Date().toLocaleString())},ls=async()=>{if(!o){console.error("Access token is missing");return}console.log("new modelGroupRetryPolicy:",e5);try{await (0,u.K_)(o,{router_settings:{model_group_retry_policy:e5}}),k.ZP.success("Retry settings saved successfully")}catch(e){console.error("Failed to save retry settings:",e),k.ZP.error("Failed to save retry settings")}};if((0,r.useEffect)(()=>{if(!o||!d||!c||!m)return;let e=async()=>{try{var e,l,s,t,n,a,r,i;let d=await (0,u.hy)(o);J(d);let h=await (0,u.AZ)(o,m,c);console.log("Model data response:",h.data),g(h);let x=new Set;for(let e=0;e0&&(j=p[p.length-1],console.log("_initial_model_group:",j),eM(j)),console.log("selectedModelGroup:",eF);let Z=await (0,u.o6)(o,m,c,j,null===(e=e2.from)||void 0===e?void 0:e.toISOString(),null===(l=e2.to)||void 0===l?void 0:l.toISOString());console.log("Model metrics response:",Z),eK(Z.data),eq(Z.all_api_bases);let f=await (0,u.Rg)(o,j,null===(s=e2.from)||void 0===s?void 0:s.toISOString(),null===(t=e2.to)||void 0===t?void 0:t.toISOString());eV(f.data),eW(f.all_api_bases);let _=await (0,u.N8)(o,m,c,j,null===(n=e2.from)||void 0===n?void 0:n.toISOString(),null===(a=e2.to)||void 0===a?void 0:a.toISOString());console.log("Model exceptions response:",_),eY(_.data),e$(_.exception_types);let y=await (0,u.fP)(o,m,c,j,null===(r=e2.from)||void 0===r?void 0:r.toISOString(),null===(i=e2.to)||void 0===i?void 0:i.toISOString());console.log("slowResponses:",y),e1(y);let b=(await (0,u.BL)(o,m,c)).router_settings;console.log("routerSettingsInfo:",b);let v=b.model_group_retry_policy,S=b.num_retries;console.log("model_group_retry_policy:",v),console.log("default_retries:",S),e8(v),e6(S)}catch(e){console.error("There was an error fetching the model data",e)}};o&&d&&c&&m&&e();let l=async()=>{let e=await (0,u.qm)();console.log("received model cost map data: ".concat(Object.keys(e))),C(e)};null==N&&l(),ll()},[o,d,c,m,N,E]),!h||!o||!d||!c||!m)return(0,a.jsx)("div",{children:"Loading..."});let lt=[];for(let e=0;e(console.log("GET PROVIDER CALLED! - ".concat(N)),null!=N&&"object"==typeof N&&e in N)?N[e].litellm_provider:"openai";if(n){let e=n.split("/"),l=e[0];r=1===e.length?u(n):l}else r="openai";a&&(i=null==a?void 0:a.input_cost_per_token,o=null==a?void 0:a.output_cost_per_token,d=null==a?void 0:a.max_tokens,c=null==a?void 0:a.max_input_tokens),(null==t?void 0:t.litellm_params)&&(m=Object.fromEntries(Object.entries(null==t?void 0:t.litellm_params).filter(e=>{let[l]=e;return"model"!==l&&"api_base"!==l}))),h.data[e].provider=r,h.data[e].input_cost=i,h.data[e].output_cost=o,h.data[e].input_cost&&(h.data[e].input_cost=(1e6*Number(h.data[e].input_cost)).toFixed(2)),h.data[e].output_cost&&(h.data[e].output_cost=(1e6*Number(h.data[e].output_cost)).toFixed(2)),h.data[e].max_tokens=d,h.data[e].max_input_tokens=c,h.data[e].api_base=null==t?void 0:null===(s=t.litellm_params)||void 0===s?void 0:s.api_base,h.data[e].cleanedLitellmParams=m,lt.push(t.model_name),console.log(h.data[e])}if(c&&"Admin Viewer"==c){let{Title:e,Paragraph:l}=ee.default;return(0,a.jsxs)("div",{children:[(0,a.jsx)(e,{level:1,children:"Access Denied"}),(0,a.jsx)(l,{children:"Ask your proxy admin for access to view all models"})]})}let ln=e=>{console.log("received provider string: ".concat(e));let l=Object.keys(n).find(l=>n[l]===e);if(l){let e=eN[l];console.log("mappingResult: ".concat(e));let s=[];"object"==typeof N&&Object.entries(N).forEach(l=>{let[t,n]=l;null!==n&&"object"==typeof n&&"litellm_provider"in n&&(n.litellm_provider===e||n.litellm_provider.includes(e))&&s.push(t)}),W(s),console.log("providerModels: ".concat(G))}},la=async()=>{try{k.ZP.info("Running health check..."),el("");let e=await (0,u.EY)(o);el(e)}catch(e){console.error("Error running health check:",e),el("Error running health check")}},lr=async(e,l,s)=>{if(console.log("Updating model metrics for group:",e),o&&m&&c&&l&&s){console.log("inside updateModelMetrics - startTime:",l,"endTime:",s),eM(e);try{let t=await (0,u.o6)(o,m,c,e,l.toISOString(),s.toISOString());console.log("Model metrics response:",t),eK(t.data),eq(t.all_api_bases);let n=await (0,u.Rg)(o,e,l.toISOString(),s.toISOString());eV(n.data),eW(n.all_api_bases);let a=await (0,u.N8)(o,m,c,e,l.toISOString(),s.toISOString());console.log("Model exceptions response:",a),eY(a.data),e$(a.exception_types);let r=await (0,u.fP)(o,m,c,e,l.toISOString(),s.toISOString());console.log("slowResponses:",r),e1(r)}catch(e){console.error("Failed to fetch model metrics",e)}}},li=e=>{var l,s;let{payload:t,active:n}=e;if(!n||!t)return null;let r=null===(s=t[0])||void 0===s?void 0:null===(l=s.payload)||void 0===l?void 0:l.date,i=t.sort((e,l)=>l.value-e.value);if(i.length>5){let e=i.length-5;(i=i.slice(0,5)).push({dataKey:"".concat(e," other deployments"),value:t.slice(5).reduce((e,l)=>e+l.value,0),color:"gray"})}return(0,a.jsxs)("div",{className:"w-150 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown",children:[r&&(0,a.jsxs)("p",{className:"text-tremor-content-emphasis mb-2",children:["Date: ",r]}),i.map((e,l)=>{let s=parseFloat(e.value.toFixed(5)),t=0===s&&e.value>0?"<0.00001":s.toFixed(5);return(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("div",{className:"w-2 h-2 mt-1 rounded-full bg-".concat(e.color,"-500")}),(0,a.jsx)("p",{className:"text-tremor-content",children:e.dataKey})]}),(0,a.jsx)("p",{className:"font-medium text-tremor-content-emphasis text-righ ml-2",children:t})]},l)})]})};console.log("selectedProvider: ".concat($)),console.log("providerModels.length: ".concat(G.length));let lo=Object.keys(n).find(e=>n[e]===$);return lo&&(i=Y.find(e=>e.name===eN[lo])),(0,a.jsx)("div",{style:{width:"100%",height:"100%"},children:(0,a.jsxs)(en.Z,{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,a.jsxs)(ea.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)(et.Z,{children:"All Models"}),(0,a.jsx)(et.Z,{children:"Add Model"}),(0,a.jsx)(et.Z,{children:(0,a.jsx)("pre",{children:"/health Models"})}),(0,a.jsx)(et.Z,{children:"Model Analytics"}),(0,a.jsx)(et.Z,{children:"Model Retry Settings"})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[E&&(0,a.jsxs)(_.Z,{children:["Last Refreshed: ",E]}),(0,a.jsx)(M.Z,{icon:ej.Z,variant:"shadow",size:"xs",className:"self-center",onClick:ll})]})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsxs)(er.Z,{children:[(0,a.jsxs)(x.Z,{children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(_.Z,{children:"Filter by Public Model Name"}),(0,a.jsxs)(z.Z,{className:"mb-4 mt-2 ml-2 w-50",defaultValue:eF||eO[0],onValueChange:e=>eM("all"===e?"all":e),value:eF||eO[0],children:[(0,a.jsx)(V.Z,{value:"all",children:"All Models"}),eO.map((e,l)=>(0,a.jsx)(V.Z,{value:e,onClick:()=>eM(e),children:e},l))]})]}),(0,a.jsx)(F.Z,{children:(0,a.jsxs)(L.Z,{style:{maxWidth:"1500px",width:"100%"},children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{style:{maxWidth:"150px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:"Public Model Name"}),(0,a.jsx)(B.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:"Provider"}),"Admin"===c&&(0,a.jsx)(B.Z,{style:{maxWidth:"150px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:"API Base"}),(0,a.jsxs)(B.Z,{style:{maxWidth:"85px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:["Input Price"," ",(0,a.jsx)("p",{style:{fontSize:"10px",color:"gray"},children:"/1M Tokens ($)"})]}),(0,a.jsxs)(B.Z,{style:{maxWidth:"85px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:["Output Price"," ",(0,a.jsx)("p",{style:{fontSize:"10px",color:"gray"},children:"/1M Tokens ($)"})]}),(0,a.jsx)(B.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:Z?"Created At":(0,a.jsxs)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",style:{color:"#72bcd4"},children:[" ","✨ Created At"]})}),(0,a.jsx)(B.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:Z?"Created By":(0,a.jsxs)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",style:{color:"#72bcd4"},children:[" ","✨ Created By"]})}),(0,a.jsx)(B.Z,{style:{maxWidth:"50px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:"Status"}),(0,a.jsx)(B.Z,{})]})}),(0,a.jsx)(U.Z,{children:h.data.filter(e=>"all"===eF||e.model_name===eF||null==eF||""===eF).map((e,l)=>{var s;return(0,a.jsxs)(q.Z,{style:{maxHeight:"1px",minHeight:"1px"},children:[(0,a.jsx)(D.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:e.model_name||"-"})}),(0,a.jsx)(D.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:e.provider||"-"})}),"Admin"===c&&(0,a.jsx)(D.Z,{style:{maxWidth:"150px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsx)(eu.Z,{title:e&&e.api_base,children:(0,a.jsx)("pre",{style:{maxWidth:"150px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"10px"},title:e&&e.api_base?e.api_base:"",children:e&&e.api_base?e.api_base.slice(0,20):"-"})})}),(0,a.jsx)(D.Z,{style:{maxWidth:"80px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsx)("pre",{style:{fontSize:"10px"},children:e.input_cost?e.input_cost:e.litellm_params.input_cost_per_token?(1e6*Number(e.litellm_params.input_cost_per_token)).toFixed(2):null})}),(0,a.jsx)(D.Z,{style:{maxWidth:"80px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsx)("pre",{style:{fontSize:"10px"},children:e.output_cost?e.output_cost:e.litellm_params.output_cost_per_token?(1e6*Number(e.litellm_params.output_cost_per_token)).toFixed(2):null})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:Z&&((s=e.model_info.created_at)?new Date(s).toLocaleDateString("en-US"):null)||"-"})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:Z&&e.model_info.created_by||"-"})}),(0,a.jsx)(D.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word"},children:e.model_info.db_model?(0,a.jsx)(R.Z,{size:"xs",className:"text-white",children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:"DB Model"})}):(0,a.jsx)(R.Z,{size:"xs",className:"text-black",children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:"Config Model"})})}),(0,a.jsx)(D.Z,{style:{maxWidth:"150px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsxs)(x.Z,{numItems:3,children:[(0,a.jsx)(eh.Z,{children:(0,a.jsx)(M.Z,{icon:P.Z,size:"sm",onClick:()=>e9(e)})}),(0,a.jsx)(eh.Z,{children:(0,a.jsx)(M.Z,{icon:T.Z,size:"sm",onClick:()=>e7(e)})}),(0,a.jsx)(eh.Z,{children:(0,a.jsx)(eg,{modelID:e.model_info.id,accessToken:o})})]})})]},l)})})]})})]}),(0,a.jsx)(e=>{let{visible:l,onCancel:s,model:t,onSubmit:n}=e,[r]=S.Z.useForm(),i={},o="",d="";if(t){i=t.litellm_params,o=t.model_name;let e=t.model_info;e&&(d=e.id,console.log("model_id: ".concat(d)),i.model_id=d)}return(0,a.jsx)(w.Z,{title:"Edit Model "+o,visible:l,width:800,footer:null,onOk:()=>{r.validateFields().then(e=>{n(e),r.resetFields()}).catch(e=>{console.error("Validation failed:",e)})},onCancel:s,children:(0,a.jsxs)(S.Z,{form:r,onFinish:le,initialValues:i,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"api_base",name:"api_base",children:(0,a.jsx)(j.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"tpm",name:"tpm",tooltip:"int (optional) - Tokens limit for this deployment: in tokens per minute (tpm). Find this information on your model/providers website",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"rpm",name:"rpm",tooltip:"int (optional) - Rate limit for this deployment: in requests per minute (rpm). Find this information on your model/providers website",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"max_retries",name:"max_retries",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"timeout",name:"timeout",tooltip:"int (optional) - Timeout in seconds for LLM requests (Defaults to 600 seconds)",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"stream_timeout",name:"stream_timeout",tooltip:"int (optional) - Timeout for stream requests (seconds)",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"input_cost_per_token",name:"input_cost_per_token",tooltip:"float (optional) - Input cost per token",children:(0,a.jsx)(A.Z,{min:0,step:1e-4})}),(0,a.jsx)(S.Z.Item,{label:"output_cost_per_token",name:"output_cost_per_token",tooltip:"float (optional) - Output cost per token",children:(0,a.jsx)(A.Z,{min:0,step:1e-4})}),(0,a.jsx)(S.Z.Item,{label:"model_id",name:"model_id",hidden:!0})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Save"})})]})})},{visible:e_,onCancel:()=>{ey(!1),eT(null)},model:eP,onSubmit:le}),(0,a.jsxs)(w.Z,{title:eP&&eP.model_name,visible:eC,width:800,footer:null,onCancel:()=>{eE(!1),eT(null)},children:[(0,a.jsx)(y.Z,{children:"Model Info"}),(0,a.jsx)(eS.Z,{language:"json",children:eP&&JSON.stringify(eP,null,2)})]})]}),(0,a.jsxs)(er.Z,{className:"h-full",children:[(0,a.jsx)(ek,{level:2,children:"Add new model"}),(0,a.jsx)(F.Z,{children:(0,a.jsxs)(S.Z,{form:v,onFinish:()=>{v.validateFields().then(e=>{eI(e,o,v)}).catch(e=>{console.error("Validation failed:",e)})},labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.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,a.jsx)(z.Z,{value:$.toString(),children:H.map((e,l)=>(0,a.jsx)(V.Z,{value:e,onClick:()=>{ln(e),X(e)},children:e},l))})}),(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Public Model Name",name:"model_name",tooltip:"Model name your users will pass in. Also used for load-balancing, LiteLLM will load balance between all models with this public name.",className:"mb-0",children:(0,a.jsx)(j.Z,{placeholder:"Vertex AI (Anthropic, Gemini, etc.)"===(t=$.toString())?"gemini-pro":"Anthropic"==t?"claude-3-opus":"Amazon Bedrock"==t?"claude-3-opus":"Google AI Studio"==t?"gemini-pro":"gpt-3.5-turbo"})}),(0,a.jsxs)(ex.Z,{children:[(0,a.jsx)(eh.Z,{span:10}),(0,a.jsx)(eh.Z,{span:10,children:(0,a.jsx)(_.Z,{className:"mb-3 mt-1",children:"Model name your users will pass in."})})]}),(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"LiteLLM Model Name(s)",name:"model",tooltip:"Actual model name used for making litellm.completion() call.",className:"mb-0",children:"Azure"===$?(0,a.jsx)(j.Z,{placeholder:"Enter model name"}):G.length>0?(0,a.jsx)(eo.Z,{value:G,children:G.map((e,l)=>(0,a.jsx)(ed.Z,{value:e,children:e},l))}):(0,a.jsx)(j.Z,{placeholder:"gpt-3.5-turbo-0125"})}),(0,a.jsxs)(ex.Z,{children:[(0,a.jsx)(eh.Z,{span:10}),(0,a.jsx)(eh.Z,{span:10,children:(0,a.jsxs)(_.Z,{className:"mb-3 mt-1",children:["Actual model name used for making"," ",(0,a.jsx)(ew,{href:"https://docs.litellm.ai/docs/providers",target:"_blank",children:"litellm.completion() call"}),". We'll"," ",(0,a.jsx)(ew,{href:"https://docs.litellm.ai/docs/proxy/reliability#step-1---set-deployments-on-config",target:"_blank",children:"loadbalance"})," ","models with the same 'public name'"]})})]}),void 0!==i&&i.fields.length>0&&(0,a.jsx)(ev,{fields:i.fields,selectedProvider:i.name}),"Amazon Bedrock"!=$&&"Vertex AI (Anthropic, Gemini, etc.)"!=$&&void 0===i&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"API Key",name:"api_key",children:(0,a.jsx)(j.Z,{placeholder:"sk-",type:"password"})}),"OpenAI"==$&&(0,a.jsx)(S.Z.Item,{label:"Organization ID",name:"organization_id",children:(0,a.jsx)(j.Z,{placeholder:"[OPTIONAL] my-unique-org"})}),"Vertex AI (Anthropic, Gemini, etc.)"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Vertex Project",name:"vertex_project",children:(0,a.jsx)(j.Z,{placeholder:"adroit-cadet-1234.."})}),"Vertex AI (Anthropic, Gemini, etc.)"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Vertex Location",name:"vertex_location",children:(0,a.jsx)(j.Z,{placeholder:"us-east-1"})}),"Vertex AI (Anthropic, Gemini, etc.)"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Vertex Credentials",name:"vertex_credentials",className:"mb-0",children:(0,a.jsx)(ef.Z,{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;v.setFieldsValue({vertex_credentials:l})}},l.readAsText(e)}return!1},onChange(e){"uploading"!==e.file.status&&console.log(e.file,e.fileList),"done"===e.file.status?k.ZP.success("".concat(e.file.name," file uploaded successfully")):"error"===e.file.status&&k.ZP.error("".concat(e.file.name," file upload failed."))},children:(0,a.jsx)(I.ZP,{icon:(0,a.jsx)(eZ.Z,{}),children:"Click to Upload"})})}),"Vertex AI (Anthropic, Gemini, etc.)"==$&&(0,a.jsxs)(ex.Z,{children:[(0,a.jsx)(eh.Z,{span:10}),(0,a.jsx)(eh.Z,{span:10,children:(0,a.jsx)(_.Z,{className:"mb-3 mt-1",children:"Give litellm a gcp service account(.json file), so it can make the relevant calls"})})]}),("Azure"==$||"OpenAI-Compatible Endpoints (Groq, Together AI, Mistral AI, etc.)"==$)&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"API Base",name:"api_base",children:(0,a.jsx)(j.Z,{placeholder:"https://..."})}),"Azure"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"API Version",name:"api_version",children:(0,a.jsx)(j.Z,{placeholder:"2023-07-01-preview"})}),"Azure"==$&&(0,a.jsxs)("div",{children:[(0,a.jsx)(S.Z.Item,{label:"Base Model",name:"base_model",className:"mb-0",children:(0,a.jsx)(j.Z,{placeholder:"azure/gpt-3.5-turbo"})}),(0,a.jsxs)(ex.Z,{children:[(0,a.jsx)(eh.Z,{span:10}),(0,a.jsx)(eh.Z,{span:10,children:(0,a.jsxs)(_.Z,{className:"mb-2",children:["The actual model your azure deployment uses. Used for accurate cost tracking. Select name from"," ",(0,a.jsx)(ew,{href:"https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json",target:"_blank",children:"here"})]})})]})]}),"Amazon Bedrock"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"AWS Access Key ID",name:"aws_access_key_id",tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`).",children:(0,a.jsx)(j.Z,{placeholder:""})}),"Amazon Bedrock"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"AWS Secret Access Key",name:"aws_secret_access_key",tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`).",children:(0,a.jsx)(j.Z,{placeholder:""})}),"Amazon Bedrock"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"AWS Region Name",name:"aws_region_name",tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`).",children:(0,a.jsx)(j.Z,{placeholder:"us-east-1"})}),(0,a.jsx)(S.Z.Item,{label:"LiteLLM Params",name:"litellm_extra_params",tooltip:"Optional litellm params used for making a litellm.completion() call.",className:"mb-0",children:(0,a.jsx)(ep.Z,{rows:4,placeholder:'{ "rpm": 100, "timeout": 0, "stream_timeout": 0 }'})}),(0,a.jsxs)(ex.Z,{children:[(0,a.jsx)(eh.Z,{span:10}),(0,a.jsx)(eh.Z,{span:10,children:(0,a.jsxs)(_.Z,{className:"mb-3 mt-1",children:["Pass JSON of litellm supported params"," ",(0,a.jsx)(ew,{href:"https://docs.litellm.ai/docs/completion/input",target:"_blank",children:"litellm.completion() call"})]})})]})]}),(0,a.jsx)("div",{style:{textAlign:"center",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Add Model"})}),(0,a.jsx)(eu.Z,{title:"Get help on our github",children:(0,a.jsx)(ee.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})})]})})]}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(_.Z,{children:"`/health` will run a very small request through your models configured on litellm"}),(0,a.jsx)(p.Z,{onClick:la,children:"Run `/health`"}),Q&&(0,a.jsx)("pre",{children:JSON.stringify(Q,null,2)})]})}),(0,a.jsxs)(er.Z,{children:[(0,a.jsxs)(x.Z,{numItems:2,className:"mt-2",children:[(0,a.jsxs)(eh.Z,{children:[(0,a.jsx)(_.Z,{children:"Select Time Range"}),(0,a.jsx)(es.Z,{enableSelect:!0,value:e2,onValueChange:e=>{e4(e),lr(eF,e.from,e.to)}})]}),(0,a.jsxs)(eh.Z,{children:[(0,a.jsx)(_.Z,{children:"Select Model Group"}),(0,a.jsx)(z.Z,{className:"mb-4 mt-2",defaultValue:eF||eO[0],value:eF||eO[0],children:eO.map((e,l)=>(0,a.jsx)(V.Z,{value:e,onClick:()=>lr(e,e2.from,e2.to),children:e},l))})]})]}),(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsx)(eh.Z,{children:(0,a.jsx)(F.Z,{className:"mr-2 max-h-[400px] min-h-[400px]",children:(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{variant:"line",defaultValue:"1",children:[(0,a.jsx)(et.Z,{value:"1",children:"Avg. Latency per Token"}),(0,a.jsx)(et.Z,{value:"2",children:"✨ Time to first token"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsxs)(er.Z,{children:[(0,a.jsx)("p",{className:"text-gray-500 italic",children:" (seconds/token)"}),(0,a.jsx)(_.Z,{className:"text-gray-500 italic mt-1 mb-1",children:"average Latency for successfull requests divided by the total tokens"}),eD&&eB&&(0,a.jsx)(ec.Z,{title:"Model Latency",className:"h-72",data:eD,showLegend:!1,index:"date",categories:eB,connectNulls:!0,customTooltip:li})]}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eb,{modelMetrics:ez,modelMetricsCategories:eG,customTooltip:li,premiumUser:Z})})]})]})})}),(0,a.jsx)(eh.Z,{children:(0,a.jsx)(F.Z,{className:"ml-2 max-h-[400px] min-h-[400px] overflow-y-auto",children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Deployment"}),(0,a.jsx)(B.Z,{children:"Success Responses"}),(0,a.jsxs)(B.Z,{children:["Slow Responses ",(0,a.jsx)("p",{children:"Success Responses taking 600+s"})]})]})}),(0,a.jsx)(U.Z,{children:e0.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.api_base}),(0,a.jsx)(D.Z,{children:e.total_count}),(0,a.jsx)(D.Z,{children:e.slow_count})]},l))})]})})})]}),(0,a.jsxs)(F.Z,{className:"mt-4",children:[(0,a.jsx)(y.Z,{children:"Exceptions per Model"}),(0,a.jsx)(em.Z,{className:"h-72",data:eH,index:"model",categories:eJ,stack:!0,colors:["indigo-300","rose-200","#ffcc33"],yAxisWidth:30})]})]}),(0,a.jsxs)(er.Z,{children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(_.Z,{children:"Filter by Public Model Name"}),(0,a.jsx)(z.Z,{className:"mb-4 mt-2 ml-2 w-50",defaultValue:eF||eO[0],value:eF||eO[0],onValueChange:e=>eM(e),children:eO.map((e,l)=>(0,a.jsx)(V.Z,{value:e,onClick:()=>eM(e),children:e},l))})]}),(0,a.jsxs)(y.Z,{children:["Retry Policy for ",eF]}),(0,a.jsx)(_.Z,{className:"mb-6",children:"How many retries should be attempted based on the Exception"}),eA&&(0,a.jsx)("table",{children:(0,a.jsx)("tbody",{children:Object.entries(eA).map((e,l)=>{var s;let[t,n]=e,r=null==e5?void 0:null===(s=e5[eF])||void 0===s?void 0:s[n];return null==r&&(r=e3),(0,a.jsxs)("tr",{className:"flex justify-between items-center mt-2",children:[(0,a.jsx)("td",{children:(0,a.jsx)(_.Z,{children:t})}),(0,a.jsx)("td",{children:(0,a.jsx)(A.Z,{className:"ml-5",value:r,min:0,step:1,onChange:e=>{e8(l=>{var s;let t=null!==(s=null==l?void 0:l[eF])&&void 0!==s?s:{};return{...null!=l?l:{},[eF]:{...t,[n]:e}}})}})})]},l)})})}),(0,a.jsx)(p.Z,{className:"mt-6 mr-8",onClick:ls,children:"Save"})]})]})]})})};let{Option:eE}=v.default;var eP=e=>{let{userID:l,accessToken:s,teams:t}=e,[n]=S.Z.useForm(),[i,o]=(0,r.useState)(!1),[d,c]=(0,r.useState)(null),[m,h]=(0,r.useState)([]);(0,r.useEffect)(()=>{(async()=>{try{let e=await (0,u.So)(s,l,"any"),t=[];for(let l=0;l{o(!1),n.resetFields()},g=()=>{o(!1),c(null),n.resetFields()},Z=async e=>{try{k.ZP.info("Making API Call"),o(!0),console.log("formValues in create user:",e);let t=await (0,u.Ov)(s,null,e);console.log("user create Response:",t),c(t.key),k.ZP.success("API user Created"),n.resetFields(),localStorage.removeItem("userData"+l)}catch(e){console.error("Error creating the user:",e)}};return(0,a.jsxs)("div",{children:[(0,a.jsx)(p.Z,{className:"mx-auto mb-0",onClick:()=>o(!0),children:"+ Invite User"}),(0,a.jsxs)(w.Z,{title:"Invite User",visible:i,width:800,footer:null,onOk:x,onCancel:g,children:[(0,a.jsx)(_.Z,{className:"mb-1",children:"Invite a user to login to the Admin UI and create Keys"}),(0,a.jsx)(_.Z,{className:"mb-6",children:(0,a.jsx)("b",{children:"Note: SSO Setup Required for this"})}),(0,a.jsxs)(S.Z,{form:n,onFinish:Z,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsx)(S.Z.Item,{label:"User Email",name:"user_email",children:(0,a.jsx)(j.Z,{placeholder:""})}),(0,a.jsx)(S.Z.Item,{label:"Team ID",name:"team_id",children:(0,a.jsx)(v.default,{placeholder:"Select Team ID",style:{width:"100%"},children:t?t.map(e=>(0,a.jsx)(eE,{value:e.team_id,children:e.team_alias},e.team_id)):(0,a.jsx)(eE,{value:null,children:"Default Team"},"default")})}),(0,a.jsx)(S.Z.Item,{label:"Metadata",name:"metadata",children:(0,a.jsx)(N.Z.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Create User"})})]})]}),d&&(0,a.jsxs)(w.Z,{title:"User Created Successfully",visible:i,onOk:x,onCancel:g,footer:null,children:[(0,a.jsx)("p",{children:"User has been created to access your proxy. Please Ask them to Log In."}),(0,a.jsx)("br",{}),(0,a.jsx)("p",{children:(0,a.jsx)("b",{children:"Note: This Feature is only supported through SSO on the Admin UI"})})]})]})},eT=e=>{let{accessToken:l,token:s,keys:t,userRole:n,userID:i,teams:o,setKeys:d}=e,[c,m]=(0,r.useState)(null),[h,p]=(0,r.useState)(null),[j,g]=(0,r.useState)(0),[Z,f]=r.useState(null),[y,b]=(0,r.useState)(null);return((0,r.useEffect)(()=>{if(!l||!s||!n||!i)return;let e=async()=>{try{let e=await (0,u.Br)(l,null,n,!0,j,25);console.log("user data response:",e),m(e)}catch(e){console.error("There was an error fetching the model data",e)}};l&&s&&n&&i&&e()},[l,s,n,i,j]),c&&l&&s&&n&&i)?(0,a.jsx)("div",{style:{width:"100%"},children:(0,a.jsxs)(x.Z,{className:"gap-2 p-2 h-[80vh] w-full mt-8",children:[(0,a.jsx)(eP,{userID:i,accessToken:l,teams:o}),(0,a.jsxs)(F.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[80vh] mb-4",children:[(0,a.jsx)("div",{className:"mb-4 mt-1",children:(0,a.jsx)(_.Z,{children:"These are Users on LiteLLM that created API Keys. Automatically tracked by LiteLLM"})}),(0,a.jsx)(en.Z,{children:(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsxs)(L.Z,{className:"mt-5",children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"User ID"}),(0,a.jsx)(B.Z,{children:"User Email"}),(0,a.jsx)(B.Z,{children:"User Models"}),(0,a.jsx)(B.Z,{children:"User Spend ($ USD)"}),(0,a.jsx)(B.Z,{children:"User Max Budget ($ USD)"}),(0,a.jsx)(B.Z,{children:"User API Key Aliases"})]})}),(0,a.jsx)(U.Z,{children:c.map(e=>{var l;return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.user_id}),(0,a.jsx)(D.Z,{children:e.user_email}),(0,a.jsx)(D.Z,{children:e.models&&e.models.length>0?e.models:"All Models"}),(0,a.jsx)(D.Z,{children:e.spend?null===(l=e.spend)||void 0===l?void 0:l.toFixed(2):0}),(0,a.jsx)(D.Z,{children:e.max_budget?e.max_budget:"Unlimited"}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(x.Z,{numItems:2,children:e&&e.key_aliases&&e.key_aliases.filter(e=>null!==e).length>0?(0,a.jsx)(R.Z,{size:"xs",color:"indigo",children:e.key_aliases.filter(e=>null!==e).join(", ")}):(0,a.jsx)(R.Z,{size:"xs",color:"gray",children:"No Keys"})})})]},e.user_id)})})]})}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsx)("div",{className:"flex-1 flex justify-between items-center"})]})})]})})]}),function(){if(!c)return null;let e=Math.ceil(c.length/25);return(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsxs)("div",{children:["Showing Page ",j+1," of ",e]}),(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)("button",{className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-l focus:outline-none",disabled:0===j,onClick:()=>g(j-1),children:"← Prev"}),(0,a.jsx)("button",{className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-r focus:outline-none",onClick:()=>{g(j+1)},children:"Next →"})]})]})}()]})}):(0,a.jsx)("div",{children:"Loading..."})},eO=e=>{let{teams:l,searchParams:s,accessToken:t,setTeams:n,userID:i,userRole:o}=e,[d]=S.Z.useForm(),[c]=S.Z.useForm(),{Title:m,Paragraph:g}=ee.default,[Z,f]=(0,r.useState)(""),[y,b]=(0,r.useState)(!1),[C,E]=(0,r.useState)(l?l[0]:null),[P,G]=(0,r.useState)(!1),[W,H]=(0,r.useState)(!1),[Y,J]=(0,r.useState)([]),[$,X]=(0,r.useState)(!1),[Q,el]=(0,r.useState)(null),[es,et]=(0,r.useState)({}),en=e=>{E(e),b(!0)},ea=async e=>{let s=e.team_id;if(console.log("handleEditSubmit:",e),null==t)return;let a=await (0,u.Gh)(t,e);l&&n(l.map(e=>e.team_id===s?a.data:e)),k.ZP.success("Team updated successfully"),b(!1),E(null)},er=async e=>{el(e),X(!0)},ei=async()=>{if(null!=Q&&null!=l&&null!=t){try{await (0,u.rs)(t,Q);let e=l.filter(e=>e.team_id!==Q);n(e)}catch(e){console.error("Error deleting the team:",e)}X(!1),el(null)}};(0,r.useEffect)(()=>{let e=async()=>{try{if(null===i||null===o||null===t||null===l)return;console.log("fetching team info:");let e={};for(let s=0;s<(null==l?void 0:l.length);s++){let n=l[s].team_id,a=await (0,u.Xm)(t,n);console.log("teamInfo response:",a),null!==a&&(e={...e,[n]:a})}et(e)}catch(e){console.error("Error fetching team info:",e)}};(async()=>{try{if(null===i||null===o)return;if(null!==t){let e=(await (0,u.So)(t,i,o)).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,o,l]);let eo=async e=>{try{if(null!=t){var s;let a=null==e?void 0:e.team_alias;if((null!==(s=null==l?void 0:l.map(e=>e.team_alias))&&void 0!==s?s:[]).includes(a))throw Error("Team alias ".concat(a," already exists, please pick another alias"));k.ZP.info("Creating Team");let r=await (0,u.hT)(t,e);null!==l?n([...l,r]):n([r]),console.log("response for team create call: ".concat(r)),k.ZP.success("Team created"),G(!1)}}catch(e){console.error("Error creating the team:",e),k.ZP.error("Error creating the team: "+e,20)}},ed=async e=>{try{if(null!=t&&null!=l){k.ZP.info("Adding Member");let s={role:"user",user_email:e.user_email,user_id:e.user_id},a=await (0,u.cu)(t,C.team_id,s);console.log("response for team create call: ".concat(a.data));let r=l.findIndex(e=>(console.log("team.team_id=".concat(e.team_id,"; response.data.team_id=").concat(a.data.team_id)),e.team_id===a.data.team_id));if(console.log("foundIndex: ".concat(r)),-1!==r){let e=[...l];e[r]=a.data,n(e),E(a.data)}H(!1)}}catch(e){console.error("Error creating the team:",e)}};return console.log("received teams ".concat(JSON.stringify(l))),(0,a.jsx)("div",{className:"w-full mx-4",children:(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)(m,{level:4,children:"All Teams"}),(0,a.jsxs)(F.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:[(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Team Name"}),(0,a.jsx)(B.Z,{children:"Spend (USD)"}),(0,a.jsx)(B.Z,{children:"Budget (USD)"}),(0,a.jsx)(B.Z,{children:"Models"}),(0,a.jsx)(B.Z,{children:"TPM / RPM Limits"}),(0,a.jsx)(B.Z,{children:"Info"})]})}),(0,a.jsx)(U.Z,{children:l&&l.length>0?l.map(e=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.team_alias}),(0,a.jsx)(D.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.spend}),(0,a.jsx)(D.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.max_budget?e.max_budget:"No limit"}),(0,a.jsx)(D.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},children:Array.isArray(e.models)?(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:0===e.models.length?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Proxy Models"})}):e.models.map((e,l)=>"all-proxy-models"===e?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Proxy Models"})},l):(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,a.jsx)(_.Z,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},l))}):null}),(0,a.jsx)(D.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:(0,a.jsxs)(_.Z,{children:["TPM: ",e.tpm_limit?e.tpm_limit:"Unlimited"," ",(0,a.jsx)("br",{}),"RPM:"," ",e.rpm_limit?e.rpm_limit:"Unlimited"]})}),(0,a.jsxs)(D.Z,{children:[(0,a.jsxs)(_.Z,{children:[es&&e.team_id&&es[e.team_id]&&es[e.team_id].keys&&es[e.team_id].keys.length," ","Keys"]}),(0,a.jsxs)(_.Z,{children:[es&&e.team_id&&es[e.team_id]&&es[e.team_id].team_info&&es[e.team_id].team_info.members_with_roles&&es[e.team_id].team_info.members_with_roles.length," ","Members"]})]}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(M.Z,{icon:T.Z,size:"sm",onClick:()=>en(e)}),(0,a.jsx)(M.Z,{onClick:()=>er(e.team_id),icon:O.Z,size:"sm"})]})]},e.team_id)):null})]}),$&&(0,a.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,a.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,a.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,a.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,a.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,a.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,a.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,a.jsx)("div",{className:"sm:flex sm:items-start",children:(0,a.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,a.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Team"}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this team ?"})})]})})}),(0,a.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,a.jsx)(p.Z,{onClick:ei,color:"red",className:"ml-2",children:"Delete"}),(0,a.jsx)(p.Z,{onClick:()=>{X(!1),el(null)},children:"Cancel"})]})]})]})})]})]}),(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)(p.Z,{className:"mx-auto",onClick:()=>G(!0),children:"+ Create New Team"}),(0,a.jsx)(w.Z,{title:"Create Team",visible:P,width:800,footer:null,onOk:()=>{G(!1),d.resetFields()},onCancel:()=>{G(!1),d.resetFields()},children:(0,a.jsxs)(S.Z,{form:d,onFinish:eo,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,a.jsx)(j.Z,{placeholder:""})}),(0,a.jsx)(S.Z.Item,{label:"Models",name:"models",children:(0,a.jsxs)(v.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,a.jsx)(v.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),Y.map(e=>(0,a.jsx)(v.default.Option,{value:e,children:e},e))]})}),(0,a.jsx)(S.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(A.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,a.jsx)(A.Z,{step:1,width:400})}),(0,a.jsx)(S.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,a.jsx)(A.Z,{step:1,width:400})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Create Team"})})]})})]}),(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)(m,{level:4,children:"Team Members"}),(0,a.jsx)(g,{children:"If you belong to multiple teams, this setting controls which teams members you see."}),l&&l.length>0?(0,a.jsx)(z.Z,{defaultValue:"0",children:l.map((e,l)=>(0,a.jsx)(V.Z,{value:String(l),onClick:()=>{E(e)},children:e.team_alias},l))}):(0,a.jsxs)(g,{children:["No team created. ",(0,a.jsx)("b",{children:"Defaulting to personal account."})]})]}),(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)(F.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Member Name"}),(0,a.jsx)(B.Z,{children:"Role"})]})}),(0,a.jsx)(U.Z,{children:C?C.members_with_roles.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.user_email?e.user_email:e.user_id?e.user_id:null}),(0,a.jsx)(D.Z,{children:e.role})]},l)):null})]})}),C&&(0,a.jsx)(e=>{let{visible:l,onCancel:s,team:t,onSubmit:n}=e,[r]=S.Z.useForm();return(0,a.jsx)(w.Z,{title:"Edit Team",visible:l,width:800,footer:null,onOk:()=>{r.validateFields().then(e=>{n({...e,team_id:t.team_id}),r.resetFields()}).catch(e=>{console.error("Validation failed:",e)})},onCancel:s,children:(0,a.jsxs)(S.Z,{form:r,onFinish:ea,initialValues:t,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,a.jsx)(j.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"Models",name:"models",children:(0,a.jsxs)(v.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,a.jsx)(v.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),Y&&Y.map(e=>(0,a.jsx)(v.default.Option,{value:e,children:e},e))]})}),(0,a.jsx)(S.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(A.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,a.jsx)(A.Z,{step:1,width:400})}),(0,a.jsx)(S.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,a.jsx)(A.Z,{step:1,width:400})}),(0,a.jsx)(S.Z.Item,{label:"Requests per minute Limit (RPM)",name:"team_id",hidden:!0})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Edit Team"})})]})})},{visible:y,onCancel:()=>{b(!1),E(null)},team:C,onSubmit:ea})]}),(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)(p.Z,{className:"mx-auto mb-5",onClick:()=>H(!0),children:"+ Add member"}),(0,a.jsx)(w.Z,{title:"Add member",visible:W,width:800,footer:null,onOk:()=>{H(!1),c.resetFields()},onCancel:()=>{H(!1),c.resetFields()},children:(0,a.jsxs)(S.Z,{form:d,onFinish:ed,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Email",name:"user_email",className:"mb-4",children:(0,a.jsx)(N.Z,{name:"user_email",className:"px-3 py-2 border rounded-md w-full"})}),(0,a.jsx)("div",{className:"text-center mb-4",children:"OR"}),(0,a.jsx)(S.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,a.jsx)(N.Z,{name:"user_id",className:"px-3 py-2 border rounded-md w-full"})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Add member"})})]})})]})]})})},eR=e=>{let l,{searchParams:s,accessToken:t,showSSOBanner:n}=e,[i]=S.Z.useForm(),[o]=S.Z.useForm(),{Title:d,Paragraph:c}=ee.default,[m,j]=(0,r.useState)(""),[g,Z]=(0,r.useState)(null),[f,y]=(0,r.useState)(!1),[b,v]=(0,r.useState)(!1),[A,C]=(0,r.useState)(!1),[E,P]=(0,r.useState)(!1),[O,R]=(0,r.useState)(!1);try{l=window.location.origin}catch(e){l=""}l+="/fallback/login";let G=()=>{R(!1)},W=["proxy_admin","proxy_admin_viewer"];(0,r.useEffect)(()=>{(async()=>{if(null!=t){let e=[],l=await (0,u.Xd)(t,"proxy_admin_viewer");l.forEach(l=>{e.push({user_role:l.user_role,user_id:l.user_id,user_email:l.user_email})}),console.log("proxy viewers: ".concat(l));let s=await (0,u.Xd)(t,"proxy_admin");s.forEach(l=>{e.push({user_role:l.user_role,user_id:l.user_id,user_email:l.user_email})}),console.log("proxy admins: ".concat(s)),console.log("combinedList: ".concat(e)),Z(e)}})()},[t]);let H=()=>{C(!1),o.resetFields()},Y=()=>{C(!1),o.resetFields()},J=e=>(0,a.jsxs)(S.Z,{form:i,onFinish:e,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Email",name:"user_email",className:"mb-4",children:(0,a.jsx)(N.Z,{name:"user_email",className:"px-3 py-2 border rounded-md w-full"})}),(0,a.jsx)("div",{className:"text-center mb-4",children:"OR"}),(0,a.jsx)(S.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,a.jsx)(N.Z,{name:"user_id",className:"px-3 py-2 border rounded-md w-full"})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Add member"})})]}),$=(e,l,s)=>(0,a.jsxs)(S.Z,{form:i,onFinish:e,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"User Role",name:"user_role",labelCol:{span:10},labelAlign:"left",children:(0,a.jsx)(z.Z,{value:l,children:W.map((e,l)=>(0,a.jsx)(V.Z,{value:e,children:e},l))})}),(0,a.jsx)(S.Z.Item,{label:"Team ID",name:"user_id",hidden:!0,initialValue:s,valuePropName:"user_id",className:"mt-8",children:(0,a.jsx)(N.Z,{value:s,disabled:!0})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Update role"})})]}),X=async e=>{try{if(null!=t&&null!=g){k.ZP.info("Making API Call");let l=await (0,u.pf)(t,e,null);console.log("response for team create call: ".concat(l));let s=g.findIndex(e=>(console.log("user.user_id=".concat(e.user_id,"; response.user_id=").concat(l.user_id)),e.user_id===l.user_id));console.log("foundIndex: ".concat(s)),-1==s&&(console.log("updates admin with new user"),g.push(l),Z(g)),k.ZP.success("Refresh tab to see updated user role"),C(!1)}}catch(e){console.error("Error creating the key:",e)}},Q=async e=>{try{if(null!=t&&null!=g){k.ZP.info("Making API Call");let l=await (0,u.pf)(t,e,"proxy_admin_viewer");console.log("response for team create call: ".concat(l));let s=g.findIndex(e=>(console.log("user.user_id=".concat(e.user_id,"; response.user_id=").concat(l.user_id)),e.user_id===l.user_id));console.log("foundIndex: ".concat(s)),-1==s&&(console.log("updates admin with new user"),g.push(l),Z(g)),y(!1)}}catch(e){console.error("Error creating the key:",e)}},el=async e=>{try{if(null!=t&&null!=g){k.ZP.info("Making API Call"),e.user_email,e.user_id;let l=await (0,u.pf)(t,e,"proxy_admin");console.log("response for team create call: ".concat(l));let s=g.findIndex(e=>(console.log("user.user_id=".concat(e.user_id,"; response.user_id=").concat(l.user_id)),e.user_id===l.user_id));console.log("foundIndex: ".concat(s)),-1==s&&(console.log("updates admin with new user"),g.push(l),Z(g)),v(!1)}}catch(e){console.error("Error creating the key:",e)}},es=async e=>{if(null==t)return;let l={environment_variables:{PROXY_BASE_URL:e.proxy_base_url,GOOGLE_CLIENT_ID:e.google_client_id,GOOGLE_CLIENT_SECRET:e.google_client_secret}};(0,u.K_)(t,l)};return console.log("admins: ".concat(null==g?void 0:g.length)),(0,a.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,a.jsx)(d,{level:4,children:"Admin Access "}),(0,a.jsxs)(c,{children:[n&&(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/ui#restrict-ui-access",children:"Requires SSO Setup"}),(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Proxy Admin: "})," Can create keys, teams, users, add models, etc. ",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Proxy Admin Viewer: "}),"Can just view spend. They cannot create keys, teams or grant users access to new models."," "]}),(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 p-2 w-full",children:[(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsx)(F.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Member Name"}),(0,a.jsx)(B.Z,{children:"Role"})]})}),(0,a.jsx)(U.Z,{children:g?g.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.user_email?e.user_email:e.user_id?e.user_id:null}),(0,a.jsx)(D.Z,{children:e.user_role}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(M.Z,{icon:T.Z,size:"sm",onClick:()=>C(!0)}),(0,a.jsx)(w.Z,{title:"Update role",visible:A,width:800,footer:null,onOk:H,onCancel:Y,children:$(X,e.user_role,e.user_id)})]})]},l)):null})]})})}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)("div",{className:"flex justify-start",children:[(0,a.jsx)(p.Z,{className:"mr-4 mb-5",onClick:()=>v(!0),children:"+ Add admin"}),(0,a.jsx)(w.Z,{title:"Add admin",visible:b,width:800,footer:null,onOk:()=>{v(!1),o.resetFields()},onCancel:()=>{v(!1),o.resetFields()},children:J(el)}),(0,a.jsx)(p.Z,{className:"mb-5",onClick:()=>y(!0),children:"+ Add viewer"}),(0,a.jsx)(w.Z,{title:"Add viewer",visible:f,width:800,footer:null,onOk:()=>{y(!1),o.resetFields()},onCancel:()=>{y(!1),o.resetFields()},children:J(Q)})]})})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsx)(d,{level:4,children:"Add SSO"}),(0,a.jsxs)("div",{className:"flex justify-start mb-4",children:[(0,a.jsx)(p.Z,{onClick:()=>P(!0),children:"Add SSO"}),(0,a.jsx)(w.Z,{title:"Add SSO",visible:E,width:800,footer:null,onOk:()=>{P(!1),i.resetFields()},onCancel:()=>{P(!1),i.resetFields()},children:(0,a.jsxs)(S.Z,{form:i,onFinish:e=>{el(e),es(e),P(!1),R(!0)},labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Admin Email",name:"user_email",rules:[{required:!0,message:"Please enter the email of the proxy admin"}],children:(0,a.jsx)(N.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"PROXY BASE URL",name:"proxy_base_url",rules:[{required:!0,message:"Please enter the proxy base url"}],children:(0,a.jsx)(N.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"GOOGLE CLIENT ID",name:"google_client_id",rules:[{required:!0,message:"Please enter the google client id"}],children:(0,a.jsx)(N.Z.Password,{})}),(0,a.jsx)(S.Z.Item,{label:"GOOGLE CLIENT SECRET",name:"google_client_secret",rules:[{required:!0,message:"Please enter the google client secret"}],children:(0,a.jsx)(N.Z.Password,{})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Save"})})]})}),(0,a.jsxs)(w.Z,{title:"SSO Setup Instructions",visible:O,width:800,footer:null,onOk:G,onCancel:()=>{R(!1)},children:[(0,a.jsx)("p",{children:"Follow these steps to complete the SSO setup:"}),(0,a.jsx)(_.Z,{className:"mt-2",children:"1. DO NOT Exit this TAB"}),(0,a.jsx)(_.Z,{className:"mt-2",children:"2. Open a new tab, visit your proxy base url"}),(0,a.jsx)(_.Z,{className:"mt-2",children:"3. Confirm your SSO is configured correctly and you can login on the new Tab"}),(0,a.jsx)(_.Z,{className:"mt-2",children:"4. If Step 3 is successful, you can close this tab"}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{onClick:G,children:"Done"})})]})]}),(0,a.jsxs)(e_.Z,{title:"Login without SSO",color:"teal",children:["If you need to login without sso, you can access ",(0,a.jsxs)("a",{href:l,target:"_blank",children:[(0,a.jsx)("b",{children:l})," "]})]})]})]})},eF=s(42556),eM=s(90252),eL=e=>{let{alertingSettings:l,handleInputChange:s,handleResetField:t,handleSubmit:n,premiumUser:r}=e,[i]=S.Z.useForm();return(0,a.jsxs)(S.Z,{form:i,onFinish:()=>{let e=i.getFieldsValue();Object.values(e).some(e=>""===e||null==e)?console.log("Some form fields are empty."):n(e)},labelAlign:"left",children:[l.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsxs)(D.Z,{align:"center",children:[(0,a.jsx)(_.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)(D.Z,{children:"Integer"===e.field_type?(0,a.jsx)(A.Z,{step:1,value:e.field_value,onChange:l=>s(e.field_name,l)}):(0,a.jsx)(N.Z,{value:e.field_value,onChange:l=>s(e.field_name,l)})})}):(0,a.jsx)(D.Z,{children:(0,a.jsx)(p.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",children:(0,a.jsx)(D.Z,{children:"Integer"===e.field_type?(0,a.jsx)(A.Z,{step:1,value:e.field_value,onChange:l=>s(e.field_name,l),className:"p-0"}):(0,a.jsx)(N.Z,{value:e.field_value,onChange:l=>s(e.field_name,l)})})}),(0,a.jsx)(D.Z,{children:!0==e.stored_in_db?(0,a.jsx)(R.Z,{icon:eM.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,a.jsx)(R.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,a.jsx)(R.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(M.Z,{icon:O.Z,color:"red",onClick:()=>t(e.field_name,l),children:"Reset"})})]},l)),(0,a.jsx)("div",{children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Update Settings"})})]})},eU=e=>{let{accessToken:l,premiumUser:s}=e,[t,n]=(0,r.useState)([]);return console.log("INSIDE ALERTING SETTINGS"),(0,r.useEffect)(()=>{l&&(0,u.RQ)(l).then(e=>{n(e)})},[l]),(0,a.jsx)(eL,{alertingSettings:t,handleInputChange:(e,l)=>{n(t.map(s=>s.field_name===e?{...s,field_value:l}: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);console.log("INSIDE HANDLE RESET FIELD"),n(l)}catch(e){console.log("ERROR OCCURRED!")}},handleSubmit:e=>{if(!l||null==e||void 0==e)return;let s={};t.forEach(e=>{s[e.field_name]=e.field_value});let n={...e,...s};try{(0,u.jA)(l,"alerting_args",n),k.ZP.success("Wait 10s for proxy to update.")}catch(e){}},premiumUser:s})};let eD=[{name:"slack",variables:{LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:null,LANGFUSE_SECRET_KEY:null,OPENMETER_API_KEY:null,SLACK_WEBHOOK_URL:null}},{name:"langfuse",variables:{LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:null,LANGFUSE_SECRET_KEY:null,OPENMETER_API_KEY:null,SLACK_WEBHOOK_URL:null}},{name:"openmeter",variables:{LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:null,LANGFUSE_SECRET_KEY:null,OPENMETER_API_KEY:null,SLACK_WEBHOOK_URL:null}}];var eK=e=>{let{accessToken:l,userRole:s,userID:t,premiumUser:n}=e,[i,o]=(0,r.useState)(eD),[d,c]=(0,r.useState)([]),[m,h]=(0,r.useState)(!1),[g]=S.Z.useForm(),[Z,f]=(0,r.useState)(null),[y,b]=(0,r.useState)([]),[N,A]=(0,r.useState)(""),[C,E]=(0,r.useState)({}),[P,T]=(0,r.useState)([]),O=e=>{P.includes(e)?T(P.filter(l=>l!==e)):T([...P,e])},M={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,r.useEffect)(()=>{l&&s&&t&&(0,u.BL)(l,t,s).then(e=>{console.log("callbacks",e);let l=eD;o(l=l.map(l=>{let s=e.callbacks.find(e=>e.name===l.name);return s?{...l,variables:{...l.variables,...s.variables}}:l}));let s=e.alerts;if(console.log("alerts_data",s),s&&s.length>0){let e=s[0];console.log("_alert_info",e);let l=e.variables.SLACK_WEBHOOK_URL;console.log("catch_all_webhook",l),T(e.active_alerts),A(l),E(e.alerts_to_webhook)}c(s)})},[l,s,t]);let z=e=>P&&P.includes(e),V=e=>{if(!l)return;let s=Object.fromEntries(Object.entries(e.variables).map(e=>{var l;let[s,t]=e;return[s,(null===(l=document.querySelector('input[name="'.concat(s,'"]')))||void 0===l?void 0:l.value)||t]}));console.log("updatedVariables",s),console.log("updateAlertTypes",y);let t={environment_variables:s,litellm_settings:{success_callback:[e.name]}};try{(0,u.K_)(l,t)}catch(e){k.ZP.error("Failed to update callback: "+e,20)}k.ZP.success("Callback updated successfully")},G=()=>{l&&g.validateFields().then(e=>{let s;if(console.log("Form values:",e),"langfuse"===e.callback){s={environment_variables:{LANGFUSE_PUBLIC_KEY:e.langfusePublicKey,LANGFUSE_SECRET_KEY:e.langfusePrivateKey},litellm_settings:{success_callback:[e.callback]}},(0,u.K_)(l,s);let t={name:e.callback,variables:{SLACK_WEBHOOK_URL:null,LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:e.langfusePublicKey,LANGFUSE_SECRET_KEY:e.langfusePrivateKey,OPENMETER_API_KEY:null}};o(i?[...i,t]:[t])}else if("slack"===e.callback){console.log("values.slackWebhookUrl: ".concat(e.slackWebhookUrl)),s={general_settings:{alerting:["slack"],alerting_threshold:300},environment_variables:{SLACK_WEBHOOK_URL:e.slackWebhookUrl}},(0,u.K_)(l,s),console.log("values.callback: ".concat(e.callback));let t={name:e.callback,variables:{SLACK_WEBHOOK_URL:e.slackWebhookUrl,LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:null,LANGFUSE_SECRET_KEY:null,OPENMETER_API_KEY:null}};o(i?[...i,t]:[t])}else if("openmeter"==e.callback){console.log("values.openMeterApiKey: ".concat(e.openMeterApiKey)),s={environment_variables:{OPENMETER_API_KEY:e.openMeterApiKey},litellm_settings:{success_callback:[e.callback]}},(0,u.K_)(l,s);let t={name:e.callback,variables:{SLACK_WEBHOOK_URL:null,LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:null,LANGFUSE_SECRET_KEY:null,OPENMETER_API_KEY:e.openMeterAPIKey}};o(i?[...i,t]:[t])}else s={error:"Invalid callback value"};h(!1),g.resetFields(),f(null)})};return l?(console.log("callbacks: ".concat(i)),(0,a.jsxs)("div",{className:"w-full mx-4",children:[(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:[(0,a.jsx)(e_.Z,{title:"[UI] Presidio PII + Guardrails Coming Soon. https://docs.litellm.ai/docs/proxy/pii_masking",color:"sky"}),(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{variant:"line",defaultValue:"1",children:[(0,a.jsx)(et.Z,{value:"1",children:"Logging Callbacks"}),(0,a.jsx)(et.Z,{value:"2",children:"Alerting Types"}),(0,a.jsx)(et.Z,{value:"2",children:"Alerting Settings"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsx)(F.Z,{children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Callback"}),(0,a.jsx)(B.Z,{children:"Callback Env Vars"})]})}),(0,a.jsx)(U.Z,{children:i.filter(e=>"slack"!==e.name).map((e,s)=>{var t;return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:(0,a.jsx)(R.Z,{color:"emerald",children:e.name})}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)("ul",{children:Object.entries(null!==(t=e.variables)&&void 0!==t?t:{}).filter(l=>{let[s,t]=l;return s.toLowerCase().includes(e.name)}).map(e=>{let[l,s]=e;return(0,a.jsxs)("li",{children:[(0,a.jsx)(_.Z,{className:"mt-2",children:l}),"LANGFUSE_HOST"===l?(0,a.jsx)("p",{children:"default value=https://cloud.langfuse.com"}):(0,a.jsx)("div",{}),(0,a.jsx)(j.Z,{name:l,defaultValue:s,type:"password"})]},l)})}),(0,a.jsx)(p.Z,{className:"mt-2",onClick:()=>V(e),children:"Save Changes"}),(0,a.jsx)(p.Z,{onClick:()=>(0,u.jE)(l,e.name),className:"mx-2",children:"Test Callback"})]})]},s)})})]})})}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(F.Z,{children:[(0,a.jsxs)(_.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)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{}),(0,a.jsx)(B.Z,{}),(0,a.jsx)(B.Z,{children:"Slack Webhook URL"})]})}),(0,a.jsx)(U.Z,{children:Object.entries(M).map((e,l)=>{let[s,t]=e;return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:"region_outage_alerts"==s?n?(0,a.jsx)(eF.Z,{id:"switch",name:"switch",checked:z(s),onChange:()=>O(s)}):(0,a.jsx)(p.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)(eF.Z,{id:"switch",name:"switch",checked:z(s),onChange:()=>O(s)})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(_.Z,{children:t})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(j.Z,{name:s,type:"password",defaultValue:C&&C[s]?C[s]:N})})]},l)})})]}),(0,a.jsx)(p.Z,{size:"xs",className:"mt-2",onClick:()=>{if(!l)return;let e={};Object.entries(M).forEach(l=>{let[s,t]=l,n=document.querySelector('input[name="'.concat(s,'"]'));console.log("key",s),console.log("webhookInput",n);let a=(null==n?void 0:n.value)||"";console.log("newWebhookValue",a),e[s]=a}),console.log("updatedAlertToWebhooks",e);let s={general_settings:{alert_to_webhook_url:e,alert_types:P}};console.log("payload",s);try{(0,u.K_)(l,s)}catch(e){k.ZP.error("Failed to update alerts: "+e,20)}k.ZP.success("Alerts updated successfully")},children:"Save Changes"}),(0,a.jsx)(p.Z,{onClick:()=>(0,u.jE)(l,"slack"),className:"mx-2",children:"Test Alerts"})]})}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eU,{accessToken:l,premiumUser:n})})]})]})]}),(0,a.jsx)(w.Z,{title:"Add Callback",visible:m,onOk:G,width:800,onCancel:()=>{h(!1),g.resetFields(),f(null)},footer:null,children:(0,a.jsxs)(S.Z,{form:g,layout:"vertical",onFinish:G,children:[(0,a.jsx)(S.Z.Item,{label:"Callback",name:"callback",rules:[{required:!0,message:"Please select a callback"}],children:(0,a.jsxs)(v.default,{onChange:e=>{f(e)},children:[(0,a.jsx)(v.default.Option,{value:"langfuse",children:"langfuse"}),(0,a.jsx)(v.default.Option,{value:"openmeter",children:"openmeter"})]})}),"langfuse"===Z&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"LANGFUSE_PUBLIC_KEY",name:"langfusePublicKey",rules:[{required:!0,message:"Please enter the public key"}],children:(0,a.jsx)(j.Z,{type:"password"})}),(0,a.jsx)(S.Z.Item,{label:"LANGFUSE_PRIVATE_KEY",name:"langfusePrivateKey",rules:[{required:!0,message:"Please enter the private key"}],children:(0,a.jsx)(j.Z,{type:"password"})})]}),"openmeter"==Z&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(S.Z.Item,{label:"OPENMETER_API_KEY",name:"openMeterApiKey",rules:[{required:!0,message:"Please enter the openmeter api key"}],children:(0,a.jsx)(j.Z,{type:"password"})})}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Save"})})]})})]})):null};let{Option:eB}=v.default;var eq=e=>{let{models:l,accessToken:s,routerSettings:t,setRouterSettings:n}=e,[i]=S.Z.useForm(),[o,d]=(0,r.useState)(!1),[c,m]=(0,r.useState)("");return(0,a.jsxs)("div",{children:[(0,a.jsx)(p.Z,{className:"mx-auto",onClick:()=>d(!0),children:"+ Add Fallbacks"}),(0,a.jsx)(w.Z,{title:"Add Fallbacks",visible:o,width:800,footer:null,onOk:()=>{d(!1),i.resetFields()},onCancel:()=>{d(!1),i.resetFields()},children:(0,a.jsxs)(S.Z,{form:i,onFinish:e=>{console.log(e);let{model_name:l,models:a}=e,r=[...t.fallbacks||[],{[l]:a}],o={...t,fallbacks:r};console.log(o);try{(0,u.K_)(s,{router_settings:o}),n(o)}catch(e){k.ZP.error("Failed to update router settings: "+e,20)}k.ZP.success("router settings updated successfully"),d(!1),i.resetFields()},labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Public Model Name",name:"model_name",rules:[{required:!0,message:"Set the model to fallback for"}],help:"required",children:(0,a.jsx)(z.Z,{defaultValue:c,children:l&&l.map((e,l)=>(0,a.jsx)(V.Z,{value:e,onClick:()=>m(e),children:e},l))})}),(0,a.jsx)(S.Z.Item,{label:"Fallback Models",name:"models",rules:[{required:!0,message:"Please select a model"}],help:"required",children:(0,a.jsx)(eo.Z,{value:l,children:l&&l.filter(e=>e!=c).map(e=>(0,a.jsx)(ed.Z,{value:e,children:e},e))})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Add Fallbacks"})})]})})]})},ez=s(12968);async function eV(e,l){console.log("isLocal:",!1);let s=window.location.origin,t=new ez.ZP.OpenAI({apiKey:l,baseURL:s,dangerouslyAllowBrowser:!0});try{let l=await t.chat.completions.create({model:e,messages:[{role:"user",content:"Hi, this is a test message"}],mock_testing_fallbacks:!0});k.ZP.success((0,a.jsxs)("span",{children:["Test model=",(0,a.jsx)("strong",{children:e}),", received model=",(0,a.jsx)("strong",{children:l.model}),". See"," ",(0,a.jsx)("a",{href:"#",onClick:()=>window.open("https://docs.litellm.ai/docs/proxy/reliability","_blank"),style:{textDecoration:"underline",color:"blue"},children:"curl"})]}))}catch(e){k.ZP.error("Error occurred while generating model response. Please try again. Error: ".concat(e),20)}}let eG={ttl:3600,lowest_latency_buffer:0},eW=e=>{let{selectedStrategy:l,strategyArgs:s,paramExplanation:t}=e;return(0,a.jsxs)(g.Z,{children:[(0,a.jsx)(f.Z,{className:"text-sm font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Routing Strategy Specific Args"}),(0,a.jsx)(Z.Z,{children:"latency-based-routing"==l?(0,a.jsx)(F.Z,{children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Setting"}),(0,a.jsx)(B.Z,{children:"Value"})]})}),(0,a.jsx)(U.Z,{children:Object.entries(s).map(e=>{let[l,s]=e;return(0,a.jsxs)(q.Z,{children:[(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(_.Z,{children:l}),(0,a.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:t[l]})]}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(j.Z,{name:l,defaultValue:"object"==typeof s?JSON.stringify(s,null,2):s.toString()})})]},l)})})]})}):(0,a.jsx)(_.Z,{children:"No specific settings"})})]})};var eH=e=>{let{accessToken:l,userRole:s,userID:t,modelData:n}=e,[i,o]=(0,r.useState)({}),[d,c]=(0,r.useState)({}),[m,g]=(0,r.useState)([]),[Z,f]=(0,r.useState)(!1),[b]=S.Z.useForm(),[v,w]=(0,r.useState)(null),[N,I]=(0,r.useState)(null),[C,E]=(0,r.useState)(null),P={routing_strategy_args:"(dict) Arguments to pass to the routing strategy",routing_strategy:"(string) Routing strategy to use",allowed_fails:"(int) Number of times a deployment can fail before being added to cooldown",cooldown_time:"(int) time in seconds to cooldown a deployment after failure",num_retries:"(int) Number of retries for failed requests. Defaults to 0.",timeout:"(float) Timeout for requests. Defaults to None.",retry_after:"(int) Minimum time to wait before retrying a failed request",ttl:"(int) Sliding window to look back over when calculating the average latency of a deployment. Default - 1 hour (in seconds).",lowest_latency_buffer:"(float) Shuffle between deployments within this % of the lowest latency. Default - 0 (i.e. always pick lowest latency)."};(0,r.useEffect)(()=>{l&&s&&t&&((0,u.BL)(l,t,s).then(e=>{console.log("callbacks",e),o(e.router_settings)}),(0,u.YU)(l).then(e=>{g(e)}))},[l,s,t]);let T=async e=>{if(l){console.log("received key: ".concat(e)),console.log("routerSettings['fallbacks']: ".concat(i.fallbacks)),i.fallbacks.map(l=>(e in l&&delete l[e],l));try{await (0,u.K_)(l,{router_settings:i}),o({...i}),I(i.routing_strategy),k.ZP.success("Router settings updated successfully")}catch(e){k.ZP.error("Failed to update router settings: "+e,20)}}},G=(e,l)=>{g(m.map(s=>s.field_name===e?{...s,field_value:l}:s))},W=(e,s)=>{if(!l)return;let t=m[s].field_value;if(null!=t&&void 0!=t)try{(0,u.jA)(l,e,t);let s=m.map(l=>l.field_name===e?{...l,stored_in_db:!0}:l);g(s)}catch(e){}},H=(e,s)=>{if(l)try{(0,u.ao)(l,e);let s=m.map(l=>l.field_name===e?{...l,stored_in_db:null,field_value:null}:l);g(s)}catch(e){}},Y=e=>{if(!l)return;console.log("router_settings",e);let s=Object.fromEntries(Object.entries(e).map(e=>{let[l,s]=e;if("routing_strategy_args"!==l&&"routing_strategy"!==l){var t;return[l,(null===(t=document.querySelector('input[name="'.concat(l,'"]')))||void 0===t?void 0:t.value)||s]}if("routing_strategy"==l)return[l,N];if("routing_strategy_args"==l&&"latency-based-routing"==N){let e={},l=document.querySelector('input[name="lowest_latency_buffer"]'),s=document.querySelector('input[name="ttl"]');return(null==l?void 0:l.value)&&(e.lowest_latency_buffer=Number(l.value)),(null==s?void 0:s.value)&&(e.ttl=Number(s.value)),console.log("setRoutingStrategyArgs: ".concat(e)),["routing_strategy_args",e]}return null}).filter(e=>null!=e));console.log("updatedVariables",s);try{(0,u.K_)(l,{router_settings:s})}catch(e){k.ZP.error("Failed to update router settings: "+e,20)}k.ZP.success("router settings updated successfully")};return l?(0,a.jsx)("div",{className:"w-full mx-4",children:(0,a.jsxs)(en.Z,{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,a.jsxs)(ea.Z,{variant:"line",defaultValue:"1",children:[(0,a.jsx)(et.Z,{value:"1",children:"Loadbalancing"}),(0,a.jsx)(et.Z,{value:"2",children:"Fallbacks"}),(0,a.jsx)(et.Z,{value:"3",children:"General"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:[(0,a.jsx)(y.Z,{children:"Router Settings"}),(0,a.jsxs)(F.Z,{children:[(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Setting"}),(0,a.jsx)(B.Z,{children:"Value"})]})}),(0,a.jsx)(U.Z,{children:Object.entries(i).filter(e=>{let[l,s]=e;return"fallbacks"!=l&&"context_window_fallbacks"!=l&&"routing_strategy_args"!=l}).map(e=>{let[l,s]=e;return(0,a.jsxs)(q.Z,{children:[(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(_.Z,{children:l}),(0,a.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:P[l]})]}),(0,a.jsx)(D.Z,{children:"routing_strategy"==l?(0,a.jsxs)(z.Z,{defaultValue:s,className:"w-full max-w-md",onValueChange:I,children:[(0,a.jsx)(V.Z,{value:"usage-based-routing",children:"usage-based-routing"}),(0,a.jsx)(V.Z,{value:"latency-based-routing",children:"latency-based-routing"}),(0,a.jsx)(V.Z,{value:"simple-shuffle",children:"simple-shuffle"})]}):(0,a.jsx)(j.Z,{name:l,defaultValue:"object"==typeof s?JSON.stringify(s,null,2):s.toString()})})]},l)})})]}),(0,a.jsx)(eW,{selectedStrategy:N,strategyArgs:i&&i.routing_strategy_args&&Object.keys(i.routing_strategy_args).length>0?i.routing_strategy_args:eG,paramExplanation:P})]}),(0,a.jsx)(h.Z,{children:(0,a.jsx)(p.Z,{className:"mt-2",onClick:()=>Y(i),children:"Save Changes"})})]})}),(0,a.jsxs)(er.Z,{children:[(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Model Name"}),(0,a.jsx)(B.Z,{children:"Fallbacks"})]})}),(0,a.jsx)(U.Z,{children:i.fallbacks&&i.fallbacks.map((e,s)=>Object.entries(e).map(e=>{let[t,n]=e;return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:t}),(0,a.jsx)(D.Z,{children:Array.isArray(n)?n.join(", "):n}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(p.Z,{onClick:()=>eV(t,l),children:"Test Fallback"})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(M.Z,{icon:O.Z,size:"sm",onClick:()=>T(t)})})]},s.toString()+t)}))})]}),(0,a.jsx)(eq,{models:(null==n?void 0:n.data)?n.data.map(e=>e.model_name):[],accessToken:l,routerSettings:i,setRouterSettings:o})]}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(F.Z,{children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Setting"}),(0,a.jsx)(B.Z,{children:"Value"}),(0,a.jsx)(B.Z,{children:"Status"}),(0,a.jsx)(B.Z,{children:"Action"})]})}),(0,a.jsx)(U.Z,{children:m.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(_.Z,{children:e.field_name}),(0,a.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:e.field_description})]}),(0,a.jsx)(D.Z,{children:"Integer"==e.field_type?(0,a.jsx)(A.Z,{step:1,value:e.field_value,onChange:l=>G(e.field_name,l)}):null}),(0,a.jsx)(D.Z,{children:!0==e.stored_in_db?(0,a.jsx)(R.Z,{icon:eM.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,a.jsx)(R.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,a.jsx)(R.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(p.Z,{onClick:()=>W(e.field_name,l),children:"Update"}),(0,a.jsx)(M.Z,{icon:O.Z,color:"red",onClick:()=>H(e.field_name,l),children:"Reset"})]})]},l))})]})})})]})]})}):null},eY=e=>{let{isModalVisible:l,accessToken:s,setIsModalVisible:t,setBudgetList:n}=e,[r]=S.Z.useForm(),i=async e=>{if(null!=s&&void 0!=s)try{k.ZP.info("Making API Call");let l=await (0,u.Zr)(s,e);console.log("key create Response:",l),n(e=>e?[...e,l]:[l]),k.ZP.success("API Key Created"),r.resetFields()}catch(e){console.error("Error creating the key:",e),k.ZP.error("Error creating the key: ".concat(e),20)}};return(0,a.jsx)(w.Z,{title:"Create Budget",visible:l,width:800,footer:null,onOk:()=>{t(!1),r.resetFields()},onCancel:()=>{t(!1),r.resetFields()},children:(0,a.jsxs)(S.Z,{form:r,onFinish:i,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Budget ID",name:"budget_id",rules:[{required:!0,message:"Please input a human-friendly name for the budget"}],help:"A human-friendly name for the budget",children:(0,a.jsx)(j.Z,{placeholder:""})}),(0,a.jsx)(S.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,a.jsx)(A.Z,{step:1,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,a.jsx)(A.Z,{step:1,precision:2,width:200})}),(0,a.jsxs)(g.Z,{className:"mt-20 mb-8",children:[(0,a.jsx)(f.Z,{children:(0,a.jsx)("b",{children:"Optional Settings"})}),(0,a.jsxs)(Z.Z,{children:[(0,a.jsx)(S.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(A.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,a.jsxs)(v.default,{defaultValue:null,placeholder:"n/a",children:[(0,a.jsx)(v.default.Option,{value:"24h",children:"daily"}),(0,a.jsx)(v.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Create Budget"})})]})})},eJ=e=>{let{accessToken:l}=e,[s,t]=(0,r.useState)(!1),[n,i]=(0,r.useState)([]);(0,r.useEffect)(()=>{l&&(0,u.O3)(l).then(e=>{i(e)})},[l]);let o=async(e,s)=>{if(null==l)return;k.ZP.info("Request made"),await (0,u.NV)(l,e);let t=[...n];t.splice(s,1),i(t),k.ZP.success("Budget Deleted.")};return(0,a.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,a.jsx)(p.Z,{size:"sm",variant:"primary",className:"mb-2",onClick:()=>t(!0),children:"+ Create Budget"}),(0,a.jsx)(eY,{accessToken:l,isModalVisible:s,setIsModalVisible:t,setBudgetList:i}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(_.Z,{children:"Create a budget to assign to customers."}),(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Budget ID"}),(0,a.jsx)(B.Z,{children:"Max Budget"}),(0,a.jsx)(B.Z,{children:"TPM"}),(0,a.jsx)(B.Z,{children:"RPM"})]})}),(0,a.jsx)(U.Z,{children:n.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.budget_id}),(0,a.jsx)(D.Z,{children:e.max_budget?e.max_budget:"n/a"}),(0,a.jsx)(D.Z,{children:e.tpm_limit?e.tpm_limit:"n/a"}),(0,a.jsx)(D.Z,{children:e.rpm_limit?e.rpm_limit:"n/a"}),(0,a.jsx)(M.Z,{icon:O.Z,size:"sm",onClick:()=>o(e.budget_id,l)})]},l))})]})]}),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)(_.Z,{className:"text-base",children:"How to use budget id"}),(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{children:[(0,a.jsx)(et.Z,{children:"Assign Budget to Customer"}),(0,a.jsx)(et.Z,{children:"Test it (Curl)"}),(0,a.jsx)(et.Z,{children:"Test it (OpenAI SDK)"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"bash",children:"\ncurl -X POST --location '/end_user/new' \n-H 'Authorization: Bearer ' \n-H 'Content-Type: application/json' \n-d '{\"user_id\": \"my-customer-id', \"budget_id\": \"\"}' # \uD83D\uDC48 KEY CHANGE\n\n "})}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"bash",children:'\ncurl -X POST --location \'/chat/completions\' \n-H \'Authorization: Bearer \' \n-H \'Content-Type: application/json\' \n-d \'{\n "model": "gpt-3.5-turbo\', \n "messages":[{"role": "user", "content": "Hey, how\'s it going?"}],\n "user": "my-customer-id"\n}\' # \uD83D\uDC48 KEY CHANGE\n\n '})}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"python",children:'from openai import OpenAI\nclient = OpenAI(\n base_url="{let{}=e;return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(x.Z,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,a.jsxs)("div",{className:"mb-5",children:[(0,a.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:"OpenAI Compatible Proxy: API Reference"}),(0,a.jsx)(_.Z,{className:"mt-2 mb-2",children:"LiteLLM is OpenAI Compatible. This means your API Key works with the OpenAI SDK. Just replace the base_url to point to your litellm proxy. Example Below "}),(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{children:[(0,a.jsx)(et.Z,{children:"OpenAI Python SDK"}),(0,a.jsx)(et.Z,{children:"LlamaIndex"}),(0,a.jsx)(et.Z,{children:"Langchain Py"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"python",children:'\nimport openai\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="http://0.0.0.0:4000" # LiteLLM Proxy is OpenAI compatible, Read More: https://docs.litellm.ai/docs/proxy/user_keys\n)\n\nresponse = client.chat.completions.create(\n model="gpt-3.5-turbo", # model to send to the proxy\n messages = [\n {\n "role": "user",\n "content": "this is a test request, write a short poem"\n }\n ]\n)\n\nprint(response)\n '})}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"python",children:'\nimport os, dotenv\n\nfrom llama_index.llms import AzureOpenAI\nfrom llama_index.embeddings import AzureOpenAIEmbedding\nfrom llama_index import VectorStoreIndex, SimpleDirectoryReader, ServiceContext\n\nllm = AzureOpenAI(\n engine="azure-gpt-3.5", # model_name on litellm proxy\n temperature=0.0,\n azure_endpoint="http://0.0.0.0:4000", # litellm proxy endpoint\n api_key="sk-1234", # litellm proxy API Key\n api_version="2023-07-01-preview",\n)\n\nembed_model = AzureOpenAIEmbedding(\n deployment_name="azure-embedding-model",\n azure_endpoint="http://0.0.0.0:4000",\n api_key="sk-1234",\n api_version="2023-07-01-preview",\n)\n\n\ndocuments = SimpleDirectoryReader("llama_index_data").load_data()\nservice_context = ServiceContext.from_defaults(llm=llm, embed_model=embed_model)\nindex = VectorStoreIndex.from_documents(documents, service_context=service_context)\n\nquery_engine = index.as_query_engine()\nresponse = query_engine.query("What did the author do growing up?")\nprint(response)\n\n '})}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"python",children:'\nfrom langchain.chat_models import ChatOpenAI\nfrom langchain.prompts.chat import (\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n SystemMessagePromptTemplate,\n)\nfrom langchain.schema import HumanMessage, SystemMessage\n\nchat = ChatOpenAI(\n openai_api_base="http://0.0.0.0:4000",\n model = "gpt-3.5-turbo",\n temperature=0.1\n)\n\nmessages = [\n SystemMessage(\n content="You are a helpful assistant that im using to make a test request to."\n ),\n HumanMessage(\n content="test from litellm. tell me why it\'s amazing in 1 sentence"\n ),\n]\nresponse = chat(messages)\n\nprint(response)\n\n '})})]})]})]})})})};async function eQ(e,l,s,t){console.log("isLocal:",!1);let n=window.location.origin,a=new ez.ZP.OpenAI({apiKey:t,baseURL:n,dangerouslyAllowBrowser:!0});try{for await(let t of(await a.chat.completions.create({model:s,stream:!0,messages:[{role:"user",content:e}]})))console.log(t),t.choices[0].delta.content&&l(t.choices[0].delta.content)}catch(e){k.ZP.error("Error occurred while generating model response. Please try again. Error: ".concat(e),20)}}var e0=e=>{let{accessToken:l,token:s,userRole:t,userID:n}=e,[i,o]=(0,r.useState)(""),[d,c]=(0,r.useState)(""),[m,g]=(0,r.useState)([]),[Z,f]=(0,r.useState)(void 0),[y,b]=(0,r.useState)([]);(0,r.useEffect)(()=>{l&&s&&t&&n&&(async()=>{try{let e=await (0,u.So)(l,n,t);if(console.log("model_info:",e),(null==e?void 0:e.data.length)>0){let l=e.data.map(e=>({value:e.id,label:e.id}));console.log(l),b(l),f(e.data[0].id)}}catch(e){console.error("Error fetching model info:",e)}})()},[l,n,t]);let S=(e,l)=>{g(s=>{let t=s[s.length-1];return t&&t.role===e?[...s.slice(0,s.length-1),{role:e,content:t.content+l}]:[...s,{role:e,content:l}]})},k=async()=>{if(""!==d.trim()&&i&&s&&t&&n){g(e=>[...e,{role:"user",content:d}]);try{Z&&await eQ(d,e=>S("assistant",e),Z,i)}catch(e){console.error("Error fetching model response",e),S("assistant","Error fetching model response")}c("")}};if(t&&"Admin Viewer"==t){let{Title:e,Paragraph:l}=ee.default;return(0,a.jsxs)("div",{children:[(0,a.jsx)(e,{level:1,children:"Access Denied"}),(0,a.jsx)(l,{children:"Ask your proxy admin for access to test models"})]})}return(0,a.jsx)("div",{style:{width:"100%",position:"relative"},children:(0,a.jsx)(x.Z,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,a.jsx)(F.Z,{children:(0,a.jsxs)(en.Z,{children:[(0,a.jsx)(ea.Z,{children:(0,a.jsx)(et.Z,{children:"Chat"})}),(0,a.jsx)(ei.Z,{children:(0,a.jsxs)(er.Z,{children:[(0,a.jsx)("div",{className:"sm:max-w-2xl",children:(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(_.Z,{children:"API Key"}),(0,a.jsx)(j.Z,{placeholder:"Type API Key here",type:"password",onValueChange:o,value:i})]}),(0,a.jsxs)(h.Z,{className:"mx-2",children:[(0,a.jsx)(_.Z,{children:"Select Model:"}),(0,a.jsx)(v.default,{placeholder:"Select a Model",onChange:e=>{console.log("selected ".concat(e)),f(e)},options:y,style:{width:"200px"}})]})]})}),(0,a.jsxs)(L.Z,{className:"mt-5",style:{display:"block",maxHeight:"60vh",overflowY:"auto"},children:[(0,a.jsx)(K.Z,{children:(0,a.jsx)(q.Z,{children:(0,a.jsx)(D.Z,{})})}),(0,a.jsx)(U.Z,{children:m.map((e,l)=>(0,a.jsx)(q.Z,{children:(0,a.jsx)(D.Z,{children:"".concat(e.role,": ").concat(e.content)})},l))})]}),(0,a.jsx)("div",{className:"mt-3",style:{position:"absolute",bottom:5,width:"95%"},children:(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)(j.Z,{type:"text",value:d,onChange:e=>c(e.target.value),placeholder:"Type your message..."}),(0,a.jsx)(p.Z,{onClick:k,className:"ml-2",children:"Send"})]})})]})})]})})})})},e1=s(33509),e2=s(95781);let{Sider:e4}=e1.default;var e5=e=>{let{setPage:l,userRole:s,defaultSelectedKey:t}=e;return"Admin Viewer"==s?(0,a.jsx)(e1.default,{style:{minHeight:"100vh",maxWidth:"120px"},children:(0,a.jsx)(e4,{width:120,children:(0,a.jsxs)(e2.Z,{mode:"inline",defaultSelectedKeys:t||["4"],style:{height:"100%",borderRight:0},children:[(0,a.jsx)(e2.Z.Item,{onClick:()=>l("api-keys"),children:"API Keys"},"4"),(0,a.jsx)(e2.Z.Item,{onClick:()=>l("models"),children:"Models"},"2"),(0,a.jsx)(e2.Z.Item,{onClick:()=>l("llm-playground"),children:"Chat UI"},"3"),(0,a.jsx)(e2.Z.Item,{onClick:()=>l("usage"),children:"Usage"},"1")]})})}):(0,a.jsx)(e1.default,{style:{minHeight:"100vh",maxWidth:"145px"},children:(0,a.jsx)(e4,{width:145,children:(0,a.jsxs)(e2.Z,{mode:"inline",defaultSelectedKeys:t||["1"],style:{height:"100%",borderRight:0},children:[(0,a.jsx)(e2.Z.Item,{onClick:()=>l("api-keys"),children:(0,a.jsx)(_.Z,{children:"API Keys"})},"1"),(0,a.jsx)(e2.Z.Item,{onClick:()=>l("llm-playground"),children:(0,a.jsx)(_.Z,{children:"Test Key"})},"3"),"Admin"==s?(0,a.jsx)(e2.Z.Item,{onClick:()=>l("models"),children:(0,a.jsx)(_.Z,{children:"Models"})},"2"):null,"Admin"==s?(0,a.jsx)(e2.Z.Item,{onClick:()=>l("usage"),children:(0,a.jsx)(_.Z,{children:"Usage"})},"4"):null,"Admin"==s?(0,a.jsx)(e2.Z.Item,{onClick:()=>l("teams"),children:(0,a.jsx)(_.Z,{children:"Teams"})},"6"):null,"Admin"==s?(0,a.jsx)(e2.Z.Item,{onClick:()=>l("users"),children:(0,a.jsx)(_.Z,{children:"Users"})},"5"):null,"Admin"==s?(0,a.jsx)(e2.Z.Item,{onClick:()=>l("settings"),children:(0,a.jsx)(_.Z,{children:"Logging & Alerts"})},"8"):null,"Admin"==s?(0,a.jsx)(e2.Z.Item,{onClick:()=>l("budgets"),children:(0,a.jsx)(_.Z,{children:"Rate Limits"})},"9"):null,"Admin"==s?(0,a.jsx)(e2.Z.Item,{onClick:()=>l("general-settings"),children:(0,a.jsx)(_.Z,{children:"Router Settings"})},"10"):null,"Admin"==s?(0,a.jsx)(e2.Z.Item,{onClick:()=>l("admin-panel"),children:(0,a.jsx)(_.Z,{children:"Admin"})},"11"):null,(0,a.jsx)(e2.Z.Item,{onClick:()=>l("api_ref"),children:(0,a.jsx)(_.Z,{children:"API Reference"})},"12"),(0,a.jsx)(e2.Z.Item,{onClick:()=>l("model-hub"),children:(0,a.jsx)(_.Z,{children:"Model Hub"})},"14")]})})})},e8=s(67989),e3=s(49167),e6=s(52703),e7=e=>{let{accessToken:l,token:s,userRole:t,userID:n,keys:i,premiumUser:o}=e,d=new Date,[c,m]=(0,r.useState)([]),[j,g]=(0,r.useState)([]),[Z,f]=(0,r.useState)([]),[b,v]=(0,r.useState)([]),[S,k]=(0,r.useState)([]),[w,N]=(0,r.useState)([]),[A,I]=(0,r.useState)([]),[C,E]=(0,r.useState)([]),[P,T]=(0,r.useState)([]),[O,R]=(0,r.useState)({}),[M,G]=(0,r.useState)([]),[W,H]=(0,r.useState)(""),[Y,$]=(0,r.useState)({from:new Date(Date.now()-6048e5),to:new Date}),X=new Date(d.getFullYear(),d.getMonth(),1),Q=new Date(d.getFullYear(),d.getMonth()+1,0),ee=eu(X),el=eu(Q);console.log("keys in usage",i),console.log("premium user in usage",o);let eo=async(e,s,t)=>{if(!e||!s||!l)return;s.setHours(23,59,59,999),e.setHours(0,0,0,0),console.log("uiSelectedKey",t);let n=await (0,u.b1)(l,t,e.toISOString(),s.toISOString());console.log("End user data updated successfully",n),v(n)},ed=async(e,s)=>{e&&s&&l&&(s.setHours(23,59,59,999),e.setHours(0,0,0,0),N((await (0,u.J$)(l,e.toISOString(),s.toISOString())).spend_per_tag),console.log("Tag spend data updated successfully"))};function eu(e){let l=e.getFullYear(),s=e.getMonth()+1,t=e.getDate();return"".concat(l,"-").concat(s<10?"0"+s:s,"-").concat(t<10?"0"+t:t)}return console.log("Start date is ".concat(ee)),console.log("End date is ".concat(el)),(0,r.useEffect)(()=>{l&&s&&t&&n&&(async()=>{try{if(console.log("user role: ".concat(t)),"Admin"==t||"Admin Viewer"==t){var e,a;let t=await (0,u.FC)(l);m(t);let n=await (0,u.OU)(l,s,ee,el);console.log("provider_spend",n),T(n);let r=(await (0,u.tN)(l)).map(e=>({key:(e.key_alias||e.key_name||e.api_key).substring(0,10),spend:e.total_spend}));g(r);let i=(await (0,u.Au)(l)).map(e=>({key:e.model,spend:e.total_spend}));f(i);let o=await (0,u.mR)(l);console.log("teamSpend",o),k(o.daily_spend),I(o.teams);let d=o.total_spend_per_team;d=d.map(e=>(e.name=e.team_id||"",e.value=e.total_spend||0,e.value=e.value.toFixed(2),e)),E(d);let c=await (0,u.J$)(l,null===(e=Y.from)||void 0===e?void 0:e.toISOString(),null===(a=Y.to)||void 0===a?void 0:a.toISOString());N(c.spend_per_tag);let h=await (0,u.b1)(l,null,void 0,void 0);v(h),console.log("spend/user result",h);let x=await (0,u.wd)(l,ee,el);R(x);let p=await (0,u.xA)(l,ee,el);console.log("global activity per model",p),G(p)}else"App Owner"==t&&await (0,u.HK)(l,s,t,n,ee,el).then(async e=>{if(console.log("result from spend logs call",e),"daily_spend"in e){let l=e.daily_spend;console.log("daily spend",l),m(l);let s=e.top_api_keys;g(s)}else{let s=(await (0,u.e2)(l,function(e){let l=[];e.forEach(e=>{Object.entries(e).forEach(e=>{let[s,t]=e;"spend"!==s&&"startTime"!==s&&"models"!==s&&"users"!==s&&l.push({key:s,spend:t})})}),l.sort((e,l)=>Number(l.spend)-Number(e.spend));let s=l.slice(0,5).map(e=>e.key);return console.log("topKeys: ".concat(Object.keys(s[0]))),s}(e))).info.map(e=>({key:(e.key_name||e.key_alias).substring(0,10),spend:e.spend}));g(s),m(e)}})}catch(e){console.error("There was an error fetching the data",e)}})()},[l,s,t,n,ee,el]),(0,a.jsxs)("div",{style:{width:"100%"},className:"p-8",children:[(0,a.jsx)(J,{userID:n,userRole:t,accessToken:l,userSpend:null,selectedTeam:null}),(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{className:"mt-2",children:[(0,a.jsx)(et.Z,{children:"All Up"}),(0,a.jsx)(et.Z,{children:"Team Based Usage"}),(0,a.jsx)(et.Z,{children:"End User Usage"}),(0,a.jsx)(et.Z,{children:"Tag Based Usage"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{variant:"solid",className:"mt-1",children:[(0,a.jsx)(et.Z,{children:"Cost"}),(0,a.jsx)(et.Z,{children:"Activity"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsxs)(x.Z,{numItems:2,className:"gap-2 h-[100vh] w-full",children:[(0,a.jsx)(h.Z,{numColSpan:2,children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Monthly Spend"}),(0,a.jsx)(em.Z,{data:c,index:"date",categories:["spend"],colors:["blue"],valueFormatter:e=>"$ ".concat(new Intl.NumberFormat("us").format(e).toString()),yAxisWidth:100,tickGap:5})]})}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Top API Keys"}),(0,a.jsx)(em.Z,{className:"mt-4 h-40",data:j,index:"key",categories:["spend"],colors:["blue"],yAxisWidth:80,tickGap:5,layout:"vertical",showXAxis:!1,showLegend:!1})]})}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Top Models"}),(0,a.jsx)(em.Z,{className:"mt-4 h-40",data:Z,index:"key",categories:["spend"],colors:["blue"],yAxisWidth:200,layout:"vertical",showXAxis:!1,showLegend:!1})]})}),(0,a.jsx)(h.Z,{numColSpan:1}),(0,a.jsx)(h.Z,{numColSpan:2,children:(0,a.jsxs)(F.Z,{className:"mb-2",children:[(0,a.jsx)(y.Z,{children:"✨ Spend by Provider"}),o?(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsx)(e6.Z,{className:"mt-4 h-40",variant:"pie",data:P,index:"provider",category:"spend"})}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Provider"}),(0,a.jsx)(B.Z,{children:"Spend"})]})}),(0,a.jsx)(U.Z,{children:P.map(e=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.provider}),(0,a.jsx)(D.Z,{children:1e-5>parseFloat(e.spend.toFixed(2))?"less than 0.00":e.spend.toFixed(2)})]},e.provider))})]})})]})}):(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to use this feature"}),(0,a.jsx)(p.Z,{variant:"primary",className:"mb-2",children:(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})})]})]})})]})}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 h-[75vh] w-full",children:[(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"All Up"}),(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e3.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",O.sum_api_requests]}),(0,a.jsx)(ec.Z,{className:"h-40",data:O.daily_data,index:"date",colors:["cyan"],categories:["api_requests"],onValueChange:e=>console.log(e)})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e3.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",O.sum_total_tokens]}),(0,a.jsx)(em.Z,{className:"h-40",data:O.daily_data,index:"date",colors:["cyan"],categories:["total_tokens"],onValueChange:e=>console.log(e)})]})]})]}),o?(0,a.jsx)(a.Fragment,{children:M.map((e,l)=>(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:e.model}),(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e3.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",e.sum_api_requests]}),(0,a.jsx)(ec.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["api_requests"],onValueChange:e=>console.log(e)})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e3.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",e.sum_total_tokens]}),(0,a.jsx)(em.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["total_tokens"],onValueChange:e=>console.log(e)})]})]})]},l))}):(0,a.jsx)(a.Fragment,{children:M&&M.length>0&&M.slice(0,1).map((e,l)=>(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"✨ Activity by Model"}),(0,a.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to see analytics for all models"}),(0,a.jsx)(p.Z,{variant:"primary",className:"mb-2",children:(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:e.model}),(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e3.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",e.sum_api_requests]}),(0,a.jsx)(ec.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["api_requests"],onValueChange:e=>console.log(e)})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e3.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",e.sum_total_tokens]}),(0,a.jsx)(em.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["total_tokens"],onValueChange:e=>console.log(e)})]})]})]})]},l))})]})})]})]})}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(x.Z,{numItems:2,className:"gap-2 h-[75vh] w-full",children:[(0,a.jsxs)(h.Z,{numColSpan:2,children:[(0,a.jsxs)(F.Z,{className:"mb-2",children:[(0,a.jsx)(y.Z,{children:"Total Spend Per Team"}),(0,a.jsx)(e8.Z,{data:C})]}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Daily Spend Per Team"}),(0,a.jsx)(em.Z,{className:"h-72",data:S,showLegend:!0,index:"date",categories:A,yAxisWidth:80,colors:["blue","green","yellow","red","purple"],stack:!0})]})]}),(0,a.jsx)(h.Z,{numColSpan:2})]})}),(0,a.jsxs)(er.Z,{children:[(0,a.jsxs)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:["End-Users of your LLM API calls. Tracked when a `user` param is passed in your LLM calls ",(0,a.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/users",target:"_blank",children:"docs here"})]}),(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(_.Z,{children:"Select Time Range"}),(0,a.jsx)(es.Z,{enableSelect:!0,value:Y,onValueChange:e=>{$(e),eo(e.from,e.to,null)}})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(_.Z,{children:"Select Key"}),(0,a.jsxs)(z.Z,{defaultValue:"all-keys",children:[(0,a.jsx)(V.Z,{value:"all-keys",onClick:()=>{eo(Y.from,Y.to,null)},children:"All Keys"},"all-keys"),null==i?void 0:i.map((e,l)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,a.jsx)(V.Z,{value:String(l),onClick:()=>{eo(Y.from,Y.to,e.token)},children:e.key_alias},l):null)]})]})]}),(0,a.jsx)(F.Z,{className:"mt-4",children:(0,a.jsxs)(L.Z,{className:"max-h-[70vh] min-h-[500px]",children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"End User"}),(0,a.jsx)(B.Z,{children:"Spend"}),(0,a.jsx)(B.Z,{children:"Total Events"})]})}),(0,a.jsx)(U.Z,{children:null==b?void 0:b.map((e,l)=>{var s;return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.end_user}),(0,a.jsx)(D.Z,{children:null===(s=e.total_spend)||void 0===s?void 0:s.toFixed(4)}),(0,a.jsx)(D.Z,{children:e.total_count})]},l)})})]})})]}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(x.Z,{numItems:2,className:"gap-2 h-[75vh] w-full mb-4",children:[(0,a.jsxs)(h.Z,{numColSpan:2,children:[(0,a.jsx)(es.Z,{className:"mb-4",enableSelect:!0,value:Y,onValueChange:e=>{$(e),ed(e.from,e.to)}}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Spend Per Tag"}),(0,a.jsxs)(_.Z,{children:["Get Started Tracking cost per tag ",(0,a.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/enterprise#tracking-spend-for-custom-tags",target:"_blank",children:"here"})]}),(0,a.jsx)(em.Z,{className:"h-72",data:w,index:"name",categories:["spend"],colors:["blue"]})]})]}),(0,a.jsx)(h.Z,{numColSpan:2})]})})]})]})]})},e9=()=>{let{Title:e,Paragraph:l}=ee.default,[s,t]=(0,r.useState)(""),[n,o]=(0,r.useState)(!1),[d,c]=(0,r.useState)(null),[u,h]=(0,r.useState)(null),[x,p]=(0,r.useState)(null),[j,g]=(0,r.useState)(!0),Z=(0,i.useSearchParams)(),[f,_]=(0,r.useState)({data:[]}),y=Z.get("userID"),b=Z.get("token"),[v,S]=(0,r.useState)("api-keys"),[k,w]=(0,r.useState)(null);return(0,r.useEffect)(()=>{if(b){let e=(0,Q.o)(b);if(e){if(console.log("Decoded token:",e),console.log("Decoded key:",e.key),w(e.key),e.user_role){let l=function(e){if(!e)return"Undefined Role";switch(console.log("Received user role: ".concat(e.toLowerCase())),console.log("Received user role length: ".concat(e.toLowerCase().length)),e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(e.user_role);console.log("Decoded user_role:",l),t(l),"Admin Viewer"==l&&S("usage")}else console.log("User role not defined");e.user_email?c(e.user_email):console.log("User Email is not set ".concat(e)),e.login_method?g("username_password"==e.login_method):console.log("User Email is not set ".concat(e)),e.premium_user&&o(e.premium_user)}}},[b]),(0,a.jsx)(r.Suspense,{fallback:(0,a.jsx)("div",{children:"Loading..."}),children:(0,a.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,a.jsx)(m,{userID:y,userRole:s,userEmail:d,showSSOBanner:j,premiumUser:n}),(0,a.jsxs)("div",{className:"flex flex-1 overflow-auto",children:[(0,a.jsx)("div",{className:"mt-8",children:(0,a.jsx)(e5,{setPage:S,userRole:s,defaultSelectedKey:null})}),"api-keys"==v?(0,a.jsx)(el,{userID:y,userRole:s,teams:u,keys:x,setUserRole:t,userEmail:d,setUserEmail:c,setTeams:h,setKeys:p}):"models"==v?(0,a.jsx)(eC,{userID:y,userRole:s,token:b,accessToken:k,modelData:f,setModelData:_,premiumUser:n}):"llm-playground"==v?(0,a.jsx)(e0,{userID:y,userRole:s,token:b,accessToken:k}):"users"==v?(0,a.jsx)(eT,{userID:y,userRole:s,token:b,keys:x,teams:u,accessToken:k,setKeys:p}):"teams"==v?(0,a.jsx)(eO,{teams:u,setTeams:h,searchParams:Z,accessToken:k,userID:y,userRole:s}):"admin-panel"==v?(0,a.jsx)(eR,{setTeams:h,searchParams:Z,accessToken:k,showSSOBanner:j}):"api_ref"==v?(0,a.jsx)(eX,{}):"settings"==v?(0,a.jsx)(eK,{userID:y,userRole:s,accessToken:k,premiumUser:n}):"budgets"==v?(0,a.jsx)(eJ,{accessToken:k}):"general-settings"==v?(0,a.jsx)(eH,{userID:y,userRole:s,accessToken:k,modelData:f}):"model-hub"==v?(0,a.jsx)(e$.Z,{accessToken:k,publicPage:!1,premiumUser:n}):(0,a.jsx)(e7,{userID:y,userRole:s,token:b,accessToken:k,keys:x,premiumUser:n})]})]})})}}},function(e){e.O(0,[936,359,440,134,971,69,744],function(){return e(e.s=20661)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/page-1fb033a77b428a50.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/page-1fb033a77b428a50.js new file mode 100644 index 0000000000..82b275b531 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/page-1fb033a77b428a50.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{20661:function(e,l,s){Promise.resolve().then(s.bind(s,5347))},5347:function(e,l,s){"use strict";s.r(l),s.d(l,{default:function(){return le}});var t,n,a=s(3827),r=s(64090),i=s(47907),o=s(8792),d=s(40491),c=s(65270),m=e=>{let{userID:l,userRole:s,userEmail:t,showSSOBanner:n,premiumUser:r}=e;console.log("User ID:",l),console.log("userEmail:",t),console.log("showSSOBanner:",n),console.log("premiumUser:",r);let i=[{key:"1",label:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("p",{children:["Role: ",s]}),(0,a.jsxs)("p",{children:["ID: ",l]}),(0,a.jsxs)("p",{children:["Premium User: ",String(r)]})]})},{key:"2",label:(0,a.jsx)(o.default,{href:"/",children:(0,a.jsx)("p",{children:"Logout"})})}];return(0,a.jsxs)("nav",{className:"left-0 right-0 top-0 flex justify-between items-center h-12 mb-4",children:[(0,a.jsx)("div",{className:"text-left my-2 absolute top-0 left-0",children:(0,a.jsx)("div",{className:"flex flex-col items-center",children:(0,a.jsx)(o.default,{href:"/",children:(0,a.jsx)("button",{className:"text-gray-800 rounded text-center",children:(0,a.jsx)("img",{src:"/get_image",width:160,height:160,alt:"LiteLLM Brand",className:"mr-2"})})})})}),(0,a.jsxs)("div",{className:"text-right mx-4 my-2 absolute top-0 right-0 flex items-center justify-end space-x-2",children:[n?(0,a.jsx)("div",{style:{padding:"6px",borderRadius:"8px"},children:(0,a.jsx)("a",{href:"https://calendly.com/d/4mp-gd3-k5k/litellm-1-1-onboarding-chat",target:"_blank",style:{fontSize:"14px",textDecoration:"underline"},children:"Get enterpise license"})}):null,(0,a.jsx)("div",{style:{border:"1px solid #391085",padding:"6px",borderRadius:"8px"},children:(0,a.jsx)(d.Z,{menu:{items:i},children:(0,a.jsx)(c.Z,{children:t})})})]})]})},u=s(777),h=s(10384),x=s(46453),p=s(16450),j=s(52273),g=s(26780),Z=s(15595),f=s(6698),_=s(71801),y=s(42440),b=s(42308),v=s(50670),S=s(81583),k=s(80588),w=s(99129),N=s(44839),A=s(88707),I=s(1861);let{Option:E}=v.default;var C=e=>{let{userID:l,team:s,userRole:t,accessToken:n,data:i,setData:o}=e,[d]=S.Z.useForm(),[c,m]=(0,r.useState)(!1),[C,P]=(0,r.useState)(null),[T,O]=(0,r.useState)(null),[R,F]=(0,r.useState)([]),[M,L]=(0,r.useState)([]),U=()=>{m(!1),d.resetFields()},D=()=>{m(!1),P(null),d.resetFields()};(0,r.useEffect)(()=>{(async()=>{try{if(null===l||null===t)return;if(null!==n){let e=(await (0,u.So)(n,l,t)).data.map(e=>e.id);console.log("available_model_names:",e),F(e)}}catch(e){console.error("Error fetching user models:",e)}})()},[n,l,t]);let K=async e=>{try{var s,t,a;let r=null!==(s=null==e?void 0:e.key_alias)&&void 0!==s?s:"",c=null!==(t=null==e?void 0:e.team_id)&&void 0!==t?t:null;if((null!==(a=null==i?void 0:i.filter(e=>e.team_id===c).map(e=>e.key_alias))&&void 0!==a?a:[]).includes(r))throw Error("Key alias ".concat(r," already exists for team with ID ").concat(c,", please provide another key alias"));k.ZP.info("Making API Call"),m(!0);let h=await (0,u.wX)(n,l,e);console.log("key create Response:",h),o(e=>e?[...e,h]:[h]),P(h.key),O(h.soft_budget),k.ZP.success("API Key Created"),d.resetFields(),localStorage.removeItem("userData"+l)}catch(e){console.error("Error creating the key:",e),k.ZP.error("Error creating the key: ".concat(e),20)}};return(0,r.useEffect)(()=>{L(s&&s.models.length>0?s.models.includes("all-proxy-models")?R:s.models:R)},[s,R]),(0,a.jsxs)("div",{children:[(0,a.jsx)(p.Z,{className:"mx-auto",onClick:()=>m(!0),children:"+ Create New Key"}),(0,a.jsx)(w.Z,{title:"Create Key",visible:c,width:800,footer:null,onOk:U,onCancel:D,children:(0,a.jsxs)(S.Z,{form:d,onFinish:K,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Key Name",name:"key_alias",rules:[{required:!0,message:"Please input a key name"}],help:"required",children:(0,a.jsx)(j.Z,{placeholder:""})}),(0,a.jsx)(S.Z.Item,{label:"Team ID",name:"team_id",hidden:!0,initialValue:s?s.team_id:null,valuePropName:"team_id",className:"mt-8",children:(0,a.jsx)(N.Z,{value:s?s.team_alias:"",disabled:!0})}),(0,a.jsx)(S.Z.Item,{label:"Models",name:"models",rules:[{required:!0,message:"Please select a model"}],help:"required",children:(0,a.jsxs)(v.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},onChange:e=>{e.includes("all-team-models")&&d.setFieldsValue({models:["all-team-models"]})},children:[(0,a.jsx)(E,{value:"all-team-models",children:"All Team Models"},"all-team-models"),M.map(e=>(0,a.jsx)(E,{value:e,children:e},e))]})}),(0,a.jsxs)(g.Z,{className:"mt-20 mb-8",children:[(0,a.jsx)(f.Z,{children:(0,a.jsx)("b",{children:"Optional Settings"})}),(0,a.jsxs)(Z.Z,{children:[(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Max Budget (USD)",name:"max_budget",help:"Budget cannot exceed team max budget: $".concat((null==s?void 0:s.max_budget)!==null&&(null==s?void 0:s.max_budget)!==void 0?null==s?void 0:s.max_budget:"unlimited"),rules:[{validator:async(e,l)=>{if(l&&s&&null!==s.max_budget&&l>s.max_budget)throw Error("Budget cannot exceed team max budget: $".concat(s.max_budget))}}],children:(0,a.jsx)(A.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",help:"Team Reset Budget: ".concat((null==s?void 0:s.budget_duration)!==null&&(null==s?void 0:s.budget_duration)!==void 0?null==s?void 0:s.budget_duration:"None"),children:(0,a.jsxs)(v.default,{defaultValue:null,placeholder:"n/a",children:[(0,a.jsx)(v.default.Option,{value:"24h",children:"daily"}),(0,a.jsx)(v.default.Option,{value:"30d",children:"monthly"})]})}),(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Tokens per minute Limit (TPM)",name:"tpm_limit",help:"TPM cannot exceed team TPM limit: ".concat((null==s?void 0:s.tpm_limit)!==null&&(null==s?void 0:s.tpm_limit)!==void 0?null==s?void 0:s.tpm_limit:"unlimited"),rules:[{validator:async(e,l)=>{if(l&&s&&null!==s.tpm_limit&&l>s.tpm_limit)throw Error("TPM limit cannot exceed team TPM limit: ".concat(s.tpm_limit))}}],children:(0,a.jsx)(A.Z,{step:1,width:400})}),(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Requests per minute Limit (RPM)",name:"rpm_limit",help:"RPM cannot exceed team RPM limit: ".concat((null==s?void 0:s.rpm_limit)!==null&&(null==s?void 0:s.rpm_limit)!==void 0?null==s?void 0:s.rpm_limit:"unlimited"),rules:[{validator:async(e,l)=>{if(l&&s&&null!==s.rpm_limit&&l>s.rpm_limit)throw Error("RPM limit cannot exceed team RPM limit: ".concat(s.rpm_limit))}}],children:(0,a.jsx)(A.Z,{step:1,width:400})}),(0,a.jsx)(S.Z.Item,{label:"Expire Key (eg: 30s, 30h, 30d)",name:"duration",className:"mt-8",children:(0,a.jsx)(j.Z,{placeholder:""})}),(0,a.jsx)(S.Z.Item,{label:"Metadata",name:"metadata",className:"mt-8",children:(0,a.jsx)(N.Z.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})})]})]})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Create Key"})})]})}),C&&(0,a.jsx)(w.Z,{visible:c,onOk:U,onCancel:D,footer:null,children:(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 w-full",children:[(0,a.jsx)(y.Z,{children:"Save your Key"}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)("p",{children:["Please save this secret key somewhere safe and accessible. For security reasons, ",(0,a.jsx)("b",{children:"you will not be able to view it again"})," ","through your LiteLLM account. If you lose this secret key, you will need to generate a new one."]})}),(0,a.jsx)(h.Z,{numColSpan:1,children:null!=C?(0,a.jsxs)("div",{children:[(0,a.jsx)(_.Z,{className:"mt-3",children:"API Key:"}),(0,a.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,a.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:C})}),(0,a.jsx)(b.CopyToClipboard,{text:C,onCopy:()=>{k.ZP.success("API Key copied to clipboard")},children:(0,a.jsx)(p.Z,{className:"mt-3",children:"Copy API Key"})})]}):(0,a.jsx)(_.Z,{children:"Key being created, this might take 30s"})})]})})]})},P=s(9454),T=s(98941),O=s(33393),R=s(5),F=s(13810),M=s(61244),L=s(10827),U=s(3851),D=s(2044),K=s(64167),B=s(74480),q=s(7178),z=s(95093),V=s(27166);let{Option:G}=v.default;var W=e=>{let{userID:l,userRole:s,accessToken:t,selectedTeam:n,data:i,setData:o,teams:d}=e,[c,m]=(0,r.useState)(!1),[h,x]=(0,r.useState)(!1),[j,g]=(0,r.useState)(null),[Z,f]=(0,r.useState)(null),[b,E]=(0,r.useState)(null),[C,W]=(0,r.useState)(""),[H,Y]=(0,r.useState)(!1),[J,$]=(0,r.useState)(!1),[X,Q]=(0,r.useState)(null),[ee,el]=(0,r.useState)([]),es=new Set,[et,en]=(0,r.useState)(es);(0,r.useEffect)(()=>{(async()=>{try{if(null===l)return;if(null!==t&&null!==s){let e=(await (0,u.So)(t,l,s)).data.map(e=>e.id);console.log("available_model_names:",e),el(e)}}catch(e){console.error("Error fetching user models:",e)}})()},[t,l,s]),(0,r.useEffect)(()=>{if(d){let e=new Set;d.forEach((l,s)=>{let t=l.team_id;e.add(t)}),en(e)}},[d]);let ea=e=>{console.log("handleEditClick:",e),null==e.token&&null!==e.token_id&&(e.token=e.token_id),Q(e),Y(!0)},er=async e=>{if(null==t)return;let l=e.token;e.key=l,console.log("handleEditSubmit:",e);let s=await (0,u.Nc)(t,e);console.log("handleEditSubmit: newKeyValues",s),i&&o(i.map(e=>e.token===l?s:e)),k.ZP.success("Key updated successfully"),Y(!1),Q(null)},ei=async e=>{console.log("handleDelete:",e),null==e.token&&null!==e.token_id&&(e.token=e.token_id),null!=i&&(g(e.token),localStorage.removeItem("userData"+l),x(!0))},eo=async()=>{if(null!=j&&null!=i){try{await (0,u.I1)(t,j);let e=i.filter(e=>e.token!==j);o(e)}catch(e){console.error("Error deleting the key:",e)}x(!1),g(null)}};if(null!=i)return console.log("RERENDER TRIGGERED"),(0,a.jsxs)("div",{children:[(0,a.jsxs)(F.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh] mb-4 mt-2",children:[(0,a.jsxs)(L.Z,{className:"mt-5 max-h-[300px] min-h-[300px]",children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Key Alias"}),(0,a.jsx)(B.Z,{children:"Secret Key"}),(0,a.jsx)(B.Z,{children:"Spend (USD)"}),(0,a.jsx)(B.Z,{children:"Budget (USD)"}),(0,a.jsx)(B.Z,{children:"Models"}),(0,a.jsx)(B.Z,{children:"TPM / RPM Limits"})]})}),(0,a.jsx)(U.Z,{children:i.map(e=>{if(console.log(e),"litellm-dashboard"===e.team_id)return null;if(n){if(console.log("item team id: ".concat(e.team_id,", knownTeamIDs.has(item.team_id): ").concat(et.has(e.team_id),", selectedTeam id: ").concat(n.team_id)),(null!=n.team_id||null===e.team_id||et.has(e.team_id))&&e.team_id!=n.team_id)return null;console.log("item team id: ".concat(e.team_id,", is returned"))}return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{style:{maxWidth:"2px",whiteSpace:"pre-wrap",overflow:"hidden"},children:null!=e.key_alias?(0,a.jsx)(_.Z,{children:e.key_alias}):(0,a.jsx)(_.Z,{children:"Not Set"})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(_.Z,{children:e.key_name})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(_.Z,{children:(()=>{try{return parseFloat(e.spend).toFixed(4)}catch(l){return e.spend}})()})}),(0,a.jsx)(D.Z,{children:null!=e.max_budget?(0,a.jsx)(_.Z,{children:e.max_budget}):(0,a.jsx)(_.Z,{children:"Unlimited"})}),(0,a.jsx)(D.Z,{children:Array.isArray(e.models)?(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:0===e.models.length?(0,a.jsx)(a.Fragment,{children:n&&n.models&&n.models.length>0?n.models.map((e,l)=>"all-proxy-models"===e?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Proxy Models"})},l):"all-team-models"===e?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Team Models"})},l):(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,a.jsx)(_.Z,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},l)):(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,a.jsx)(_.Z,{children:"all-proxy-models"})})}):e.models.map((e,l)=>"all-proxy-models"===e?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Proxy Models"})},l):"all-team-models"===e?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Team Models"})},l):(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,a.jsx)(_.Z,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},l))}):null}),(0,a.jsx)(D.Z,{children:(0,a.jsxs)(_.Z,{children:["TPM: ",e.tpm_limit?e.tpm_limit:"Unlimited"," ",(0,a.jsx)("br",{})," RPM:"," ",e.rpm_limit?e.rpm_limit:"Unlimited"]})}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(M.Z,{onClick:()=>{Q(e),$(!0)},icon:P.Z,size:"sm"}),(0,a.jsx)(w.Z,{open:J,onCancel:()=>{$(!1),Q(null)},footer:null,width:800,children:X&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3 mt-8",children:[(0,a.jsxs)(F.Z,{children:[(0,a.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Spend"}),(0,a.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,a.jsx)("p",{className:"text-tremor font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:(()=>{try{return parseFloat(X.spend).toFixed(4)}catch(e){return X.spend}})()})})]}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Budget"}),(0,a.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,a.jsx)("p",{className:"text-tremor font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:null!=X.max_budget?(0,a.jsx)(a.Fragment,{children:X.max_budget}):(0,a.jsx)(a.Fragment,{children:"Unlimited"})})})]},e.name),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Expires"}),(0,a.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,a.jsx)("p",{className:"text-tremor-default font-small text-tremor-content-strong dark:text-dark-tremor-content-strong",children:null!=X.expires?(0,a.jsx)(a.Fragment,{children:new Date(X.expires).toLocaleString(void 0,{day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})}):(0,a.jsx)(a.Fragment,{children:"Never"})})})]},e.name)]}),(0,a.jsxs)(F.Z,{className:"my-4",children:[(0,a.jsx)(y.Z,{children:"Token Name"}),(0,a.jsx)(_.Z,{className:"my-1",children:X.key_alias?X.key_alias:X.key_name}),(0,a.jsx)(y.Z,{children:"Token ID"}),(0,a.jsx)(_.Z,{className:"my-1 text-[12px]",children:X.token}),(0,a.jsx)(y.Z,{children:"Metadata"}),(0,a.jsx)(_.Z,{className:"my-1",children:(0,a.jsxs)("pre",{children:[JSON.stringify(X.metadata)," "]})})]}),(0,a.jsx)(p.Z,{className:"mx-auto flex items-center",onClick:()=>{$(!1),Q(null)},children:"Close"})]})}),(0,a.jsx)(M.Z,{icon:T.Z,size:"sm",onClick:()=>ea(e)}),(0,a.jsx)(M.Z,{onClick:()=>ei(e),icon:O.Z,size:"sm"})]})]},e.token)})})]}),h&&(0,a.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,a.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,a.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,a.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,a.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,a.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,a.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,a.jsx)("div",{className:"sm:flex sm:items-start",children:(0,a.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,a.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Key"}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this key ?"})})]})})}),(0,a.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,a.jsx)(p.Z,{onClick:eo,color:"red",className:"ml-2",children:"Delete"}),(0,a.jsx)(p.Z,{onClick:()=>{x(!1),g(null)},children:"Cancel"})]})]})]})})]}),X&&(0,a.jsx)(e=>{let{visible:l,onCancel:s,token:t,onSubmit:i}=e,[o]=S.Z.useForm(),[c,m]=(0,r.useState)(n),[u,h]=(0,r.useState)([]),[x,p]=(0,r.useState)(!1);return(0,a.jsx)(w.Z,{title:"Edit Key",visible:l,width:800,footer:null,onOk:()=>{o.validateFields().then(e=>{o.resetFields()}).catch(e=>{console.error("Validation failed:",e)})},onCancel:s,children:(0,a.jsxs)(S.Z,{form:o,onFinish:er,initialValues:t,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Key Name",name:"key_alias",rules:[{required:!0,message:"Please input a key name"}],help:"required",children:(0,a.jsx)(N.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"Models",name:"models",rules:[{validator:(e,l)=>{let s=l.filter(e=>!c.models.includes(e)&&"all-team-models"!==e&&"all-proxy-models"!==e&&!c.models.includes("all-proxy-models"));return(console.log("errorModels: ".concat(s)),s.length>0)?Promise.reject("Some models are not part of the new team's models - ".concat(s,"Team models: ").concat(c.models)):Promise.resolve()}}],children:(0,a.jsxs)(v.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,a.jsx)(G,{value:"all-team-models",children:"All Team Models"},"all-team-models"),c&&c.models?c.models.includes("all-proxy-models")?ee.filter(e=>"all-proxy-models"!==e).map(e=>(0,a.jsx)(G,{value:e,children:e},e)):c.models.map(e=>(0,a.jsx)(G,{value:e,children:e},e)):ee.map(e=>(0,a.jsx)(G,{value:e,children:e},e))]})}),(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Max Budget (USD)",name:"max_budget",help:"Budget cannot exceed team max budget: ".concat((null==c?void 0:c.max_budget)!==null&&(null==c?void 0:c.max_budget)!==void 0?null==c?void 0:c.max_budget:"unlimited"),rules:[{validator:async(e,l)=>{if(l&&c&&null!==c.max_budget&&l>c.max_budget)throw console.log("keyTeam.max_budget: ".concat(c.max_budget)),Error("Budget cannot exceed team max budget: $".concat(c.max_budget))}}],children:(0,a.jsx)(A.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{label:"token",name:"token",hidden:!0}),(0,a.jsx)(S.Z.Item,{label:"Team",name:"team_id",help:"the team this key belongs to",children:(0,a.jsx)(z.Z,{value:t.team_alias,children:null==d?void 0:d.map((e,l)=>(0,a.jsx)(V.Z,{value:e.team_id,onClick:()=>m(e),children:e.team_alias},l))})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Edit Key"})})]})})},{visible:H,onCancel:()=>{Y(!1),Q(null)},token:X,onSubmit:er})]})},H=s(76032),Y=s(35152),J=e=>{let{userID:l,userRole:s,accessToken:t,userSpend:n,selectedTeam:i}=e;console.log("userSpend: ".concat(n));let[o,d]=(0,r.useState)(null!==n?n:0),[c,m]=(0,r.useState)(0),[h,x]=(0,r.useState)([]);(0,r.useEffect)(()=>{let e=async()=>{if(t&&l&&s&&"Admin"===s&&null==n)try{let e=await (0,u.Qy)(t);e&&(e.spend?d(e.spend):d(0),e.max_budget?m(e.max_budget):m(0))}catch(e){console.error("Error fetching global spend data:",e)}};(async()=>{try{if(null===l||null===s)return;if(null!==t){let e=(await (0,u.So)(t,l,s)).data.map(e=>e.id);console.log("available_model_names:",e),x(e)}}catch(e){console.error("Error fetching user models:",e)}})(),e()},[s,t,l]),(0,r.useEffect)(()=>{null!==n&&d(n)},[n]);let p=[];i&&i.models&&(p=i.models),p&&p.includes("all-proxy-models")?(console.log("user models:",h),p=h):p&&p.includes("all-team-models")?p=i.models:p&&0===p.length&&(p=h);let j=void 0!==o?o.toFixed(4):null;return console.log("spend in view user spend: ".concat(o)),(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("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:["$",j]})]}),(0,a.jsx)("div",{className:"ml-auto",children:(0,a.jsxs)(g.Z,{children:[(0,a.jsx)(f.Z,{children:(0,a.jsx)(_.Z,{children:"Team Models"})}),(0,a.jsx)(Z.Z,{className:"absolute right-0 z-10 bg-white p-2 shadow-lg max-w-xs",children:(0,a.jsx)(H.Z,{children:p.map(e=>(0,a.jsx)(Y.Z,{children:(0,a.jsx)(_.Z,{children:e})},e))})})]})})]})},$=e=>{let{userID:l,userRole:s,selectedTeam:t,accessToken:n}=e,[i,o]=(0,r.useState)([]);(0,r.useEffect)(()=>{(async()=>{try{if(null===l||null===s)return;if(null!==n){let e=(await (0,u.So)(n,l,s)).data.map(e=>e.id);console.log("available_model_names:",e),o(e)}}catch(e){console.error("Error fetching user models:",e)}})()},[n,l,s]);let d=[];return t&&t.models&&(d=t.models),d&&d.includes("all-proxy-models")&&(console.log("user models:",i),d=i),(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"mb-5",children:(0,a.jsx)("p",{className:"text-3xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:null==t?void 0:t.team_alias})})})},X=e=>{let l,{teams:s,setSelectedTeam:t,userRole:n}=e,i={models:[],team_id:null,team_alias:"Default Team"},[o,d]=(0,r.useState)(i);return(l="App User"===n?s:s?[...s,i]:[i],"App User"===n)?null:(0,a.jsxs)("div",{className:"mt-5 mb-5",children:[(0,a.jsx)(y.Z,{children:"Select Team"}),(0,a.jsx)(_.Z,{children:"If you belong to multiple teams, this setting controls which team is used by default when creating new API Keys."}),(0,a.jsxs)(_.Z,{className:"mt-3 mb-3",children:[(0,a.jsx)("b",{children:"Default Team:"})," If no team_id is set for a key, it will be grouped under here."]}),l&&l.length>0?(0,a.jsx)(z.Z,{defaultValue:"0",children:l.map((e,l)=>(0,a.jsx)(V.Z,{value:String(l),onClick:()=>t(e),children:e.team_alias},l))}):(0,a.jsxs)(_.Z,{children:["No team created. ",(0,a.jsx)("b",{children:"Defaulting to personal account."})]})]})},Q=s(37963),ee=s(97482);console.log("isLocal:",!1);var el=e=>{let{userID:l,userRole:s,teams:t,keys:n,setUserRole:o,userEmail:d,setUserEmail:c,setTeams:m,setKeys:p}=e,[j,g]=(0,r.useState)(null),Z=(0,i.useSearchParams)();Z.get("viewSpend"),(0,i.useRouter)();let f=Z.get("token"),[_,y]=(0,r.useState)(null),[b,v]=(0,r.useState)(null),[S,k]=(0,r.useState)([]),w={models:[],team_alias:"Default Team",team_id:null},[N,A]=(0,r.useState)(t?t[0]:w);if(window.addEventListener("beforeunload",function(){sessionStorage.clear()}),(0,r.useEffect)(()=>{if(f){let e=(0,Q.o)(f);if(e){if(console.log("Decoded token:",e),console.log("Decoded key:",e.key),y(e.key),e.user_role){let l=function(e){if(!e)return"Undefined Role";switch(console.log("Received user role: ".concat(e)),e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(e.user_role);console.log("Decoded user_role:",l),o(l)}else console.log("User role not defined");e.user_email?c(e.user_email):console.log("User Email is not set ".concat(e))}}if(l&&_&&s&&!n&&!j){let e=sessionStorage.getItem("userModels"+l);e?k(JSON.parse(e)):(async()=>{try{let e=await (0,u.Br)(_,l,s,!1,null,null);if(console.log("received teams in user dashboard: ".concat(Object.keys(e),"; team values: ").concat(Object.entries(e.teams))),"Admin"==s){let e=await (0,u.Qy)(_);g(e),console.log("globalSpend:",e)}else g(e.user_info);p(e.keys),m(e.teams);let t=[...e.teams];t.length>0?(console.log("response['teams']: ".concat(t)),A(t[0])):A(w),sessionStorage.setItem("userData"+l,JSON.stringify(e.keys)),sessionStorage.setItem("userSpendData"+l,JSON.stringify(e.user_info));let n=(await (0,u.So)(_,l,s)).data.map(e=>e.id);console.log("available_model_names:",n),k(n),console.log("userModels:",S),sessionStorage.setItem("userModels"+l,JSON.stringify(n))}catch(e){console.error("There was an error fetching the data",e)}})()}},[l,f,_,n,s]),(0,r.useEffect)(()=>{if(null!==n&&null!=N&&null!==N.team_id){let e=0;for(let l of n)N.hasOwnProperty("team_id")&&null!==l.team_id&&l.team_id===N.team_id&&(e+=l.spend);v(e)}else if(null!==n){let e=0;for(let l of n)e+=l.spend;v(e)}},[N]),null==l||null==f){let e="/sso/key/generate";return console.log("Full URL:",e),window.location.href=e,null}if(null==_)return null;if(null==s&&o("App Owner"),s&&"Admin Viewer"==s){let{Title:e,Paragraph:l}=ee.default;return(0,a.jsxs)("div",{children:[(0,a.jsx)(e,{level:1,children:"Access Denied"}),(0,a.jsx)(l,{children:"Ask your proxy admin for access to create keys"})]})}return console.log("inside user dashboard, selected team",N),(0,a.jsx)("div",{className:"w-full mx-4",children:(0,a.jsx)(x.Z,{numItems:1,className:"gap-2 p-8 h-[75vh] w-full mt-2",children:(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)($,{userID:l,userRole:s,selectedTeam:N||null,accessToken:_}),(0,a.jsx)(J,{userID:l,userRole:s,accessToken:_,userSpend:b,selectedTeam:N||null}),(0,a.jsx)(W,{userID:l,userRole:s,accessToken:_,selectedTeam:N||null,data:n,setData:p,teams:t}),(0,a.jsx)(C,{userID:l,team:N||null,userRole:s,accessToken:_,data:n,setData:p},N?N.team_id:null),(0,a.jsx)(X,{teams:t,setSelectedTeam:A,userRole:s})]})})})},es=s(35087),et=s(92836),en=s(26734),ea=s(41608),er=s(32126),ei=s(23682),eo=s(47047),ed=s(76628),ec=s(25707),em=s(44041),eu=s(1460),eh=s(28683),ex=s(38302),ep=s(78578),ej=s(63954),eg=e=>{let{modelID:l,accessToken:s}=e,[t,n]=(0,r.useState)(!1),i=async()=>{try{k.ZP.info("Making API Call"),n(!0);let e=await (0,u.Og)(s,l);console.log("model delete Response:",e),k.ZP.success("Model ".concat(l," deleted successfully")),n(!1)}catch(e){console.error("Error deleting the model:",e)}};return(0,a.jsxs)("div",{children:[(0,a.jsx)(M.Z,{onClick:()=>n(!0),icon:O.Z,size:"sm"}),(0,a.jsx)(w.Z,{open:t,onOk:i,okType:"danger",onCancel:()=>n(!1),children:(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 w-full",children:[(0,a.jsx)(y.Z,{children:"Delete Model"}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsx)("p",{children:"Are you sure you want to delete this model? This action is irreversible."})}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)("p",{children:["Model ID: ",(0,a.jsx)("b",{children:l})]})})]})})]})},eZ=s(97766),ef=s(46495),e_=s(18190),ey=s(91118),eb=e=>{let{modelMetrics:l,modelMetricsCategories:s,customTooltip:t,premiumUser:n}=e;return n?(0,a.jsx)(ey.Z,{title:"Time to First token (s)",className:"h-72",data:l,index:"date",showLegend:!1,categories:s,colors:["indigo","rose"],connectNulls:!0,customTooltip:t}):(0,a.jsxs)("div",{children:[(0,a.jsx)(e_.Z,{title:"✨ Enterprise Feature",color:"teal",className:"mt-2 mb-4",children:"Enterprise features are available for users with a specific license, please contact LiteLLM to unlock this limitation."}),(0,a.jsx)(p.Z,{variant:"primary",children:(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get in touch"})})]})},ev=e=>{let{fields:l,selectedProvider:s}=e;return 0===l.length?null:(0,a.jsx)(a.Fragment,{children:l.map(e=>(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:e.field_name.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),name:e.field_name,tooltip:e.field_description,className:"mb-2",children:(0,a.jsx)(j.Z,{placeholder:e.field_value,type:"password"})},e.field_name))})},eS=s(67951);let{Title:ek,Link:ew}=ee.default;(t=n||(n={})).OpenAI="OpenAI",t.Azure="Azure",t.Anthropic="Anthropic",t.Google_AI_Studio="Google AI Studio",t.Bedrock="Amazon Bedrock",t.OpenAI_Compatible="OpenAI-Compatible Endpoints (Groq, Together AI, Mistral AI, etc.)",t.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",t.Databricks="Databricks";let eN={OpenAI:"openai",Azure:"azure",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",OpenAI_Compatible:"openai",Vertex_AI:"vertex_ai",Databricks:"databricks"},eA={"BadRequestError (400)":"BadRequestErrorRetries","AuthenticationError (401)":"AuthenticationErrorRetries","TimeoutError (408)":"TimeoutErrorRetries","RateLimitError (429)":"RateLimitErrorRetries","ContentPolicyViolationError (400)":"ContentPolicyViolationErrorRetries","InternalServerError (500)":"InternalServerErrorRetries"},eI=async(e,l,s)=>{try{let t=Array.isArray(e.model)?e.model:[e.model];console.log("received deployments: ".concat(t)),console.log("received type of deployments: ".concat(typeof t)),t.forEach(async s=>{console.log("litellm_model: ".concat(s));let t={},n={};t.model=s;let a="";for(let[l,s]of(console.log("formValues add deployment:",e),Object.entries(e)))if(""!==s){if("model_name"==l)a+=s;else if("custom_llm_provider"==l)continue;else if("model"==l)continue;else if("base_model"===l)n[l]=s;else if("litellm_extra_params"==l){console.log("litellm_extra_params:",s);let e={};if(s&&void 0!=s){try{e=JSON.parse(s)}catch(e){throw k.ZP.error("Failed to parse LiteLLM Extra Params: "+e,10),Error("Failed to parse litellm_extra_params: "+e)}for(let[l,s]of Object.entries(e))t[l]=s}}else t[l]=s}let r={model_name:a,litellm_params:t,model_info:n},i=await (0,u.kK)(l,r);console.log("response for model create call: ".concat(i.data))}),s.resetFields()}catch(e){k.ZP.error("Failed to create model: "+e,10)}};var eE=e=>{var l,s,t;let i,{accessToken:o,token:d,userRole:c,userID:m,modelData:h={data:[]},setModelData:g,premiumUser:Z}=e,[f,b]=(0,r.useState)([]),[v]=S.Z.useForm(),[N,E]=(0,r.useState)(null),[C,O]=(0,r.useState)(""),[G,W]=(0,r.useState)([]),H=Object.values(n).filter(e=>isNaN(Number(e))),[Y,J]=(0,r.useState)([]),[$,X]=(0,r.useState)("OpenAI"),[Q,el]=(0,r.useState)(""),[e_,ey]=(0,r.useState)(!1),[eE,eC]=(0,r.useState)(!1),[eP,eT]=(0,r.useState)(null),[eO,eR]=(0,r.useState)([]),[eF,eM]=(0,r.useState)(null),[eL,eU]=(0,r.useState)([]),[eD,eK]=(0,r.useState)([]),[eB,eq]=(0,r.useState)([]),[ez,eV]=(0,r.useState)([]),[eG,eW]=(0,r.useState)([]),[eH,eY]=(0,r.useState)([]),[eJ,e$]=(0,r.useState)([]),[eX,eQ]=(0,r.useState)([]),[e0,e1]=(0,r.useState)([]),[e2,e4]=(0,r.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[e5,e8]=(0,r.useState)(null),[e3,e6]=(0,r.useState)(0),e7=e=>{eT(e),ey(!0)},e9=e=>{eT(e),eC(!0)},le=async e=>{if(console.log("handleEditSubmit:",e),null==o)return;let l={},s=null;for(let[t,n]of Object.entries(e))"model_id"!==t?l[t]=n:s=n;let t={litellm_params:l,model_info:{id:s}};console.log("handleEditSubmit payload:",t);try{await (0,u.um)(o,t),k.ZP.success("Model updated successfully, restart server to see updates"),ey(!1),eT(null)}catch(e){console.log("Error occurred")}},ll=()=>{O(new Date().toLocaleString())},ls=async()=>{if(!o){console.error("Access token is missing");return}console.log("new modelGroupRetryPolicy:",e5);try{await (0,u.K_)(o,{router_settings:{model_group_retry_policy:e5}}),k.ZP.success("Retry settings saved successfully")}catch(e){console.error("Failed to save retry settings:",e),k.ZP.error("Failed to save retry settings")}};if((0,r.useEffect)(()=>{if(!o||!d||!c||!m)return;let e=async()=>{try{var e,l,s,t,n,a,r,i;let d=await (0,u.hy)(o);J(d);let h=await (0,u.AZ)(o,m,c);console.log("Model data response:",h.data),g(h);let x=new Set;for(let e=0;e0&&(j=p[p.length-1],console.log("_initial_model_group:",j),eM(j)),console.log("selectedModelGroup:",eF);let Z=await (0,u.o6)(o,m,c,j,null===(e=e2.from)||void 0===e?void 0:e.toISOString(),null===(l=e2.to)||void 0===l?void 0:l.toISOString());console.log("Model metrics response:",Z),eK(Z.data),eq(Z.all_api_bases);let f=await (0,u.Rg)(o,j,null===(s=e2.from)||void 0===s?void 0:s.toISOString(),null===(t=e2.to)||void 0===t?void 0:t.toISOString());eV(f.data),eW(f.all_api_bases);let _=await (0,u.N8)(o,m,c,j,null===(n=e2.from)||void 0===n?void 0:n.toISOString(),null===(a=e2.to)||void 0===a?void 0:a.toISOString());console.log("Model exceptions response:",_),eY(_.data),e$(_.exception_types);let y=await (0,u.fP)(o,m,c,j,null===(r=e2.from)||void 0===r?void 0:r.toISOString(),null===(i=e2.to)||void 0===i?void 0:i.toISOString());console.log("slowResponses:",y),e1(y);let b=(await (0,u.BL)(o,m,c)).router_settings;console.log("routerSettingsInfo:",b);let v=b.model_group_retry_policy,S=b.num_retries;console.log("model_group_retry_policy:",v),console.log("default_retries:",S),e8(v),e6(S)}catch(e){console.error("There was an error fetching the model data",e)}};o&&d&&c&&m&&e();let l=async()=>{let e=await (0,u.qm)();console.log("received model cost map data: ".concat(Object.keys(e))),E(e)};null==N&&l(),ll()},[o,d,c,m,N,C]),!h||!o||!d||!c||!m)return(0,a.jsx)("div",{children:"Loading..."});let lt=[];for(let e=0;e(console.log("GET PROVIDER CALLED! - ".concat(N)),null!=N&&"object"==typeof N&&e in N)?N[e].litellm_provider:"openai";if(n){let e=n.split("/"),l=e[0];r=1===e.length?u(n):l}else r="openai";a&&(i=null==a?void 0:a.input_cost_per_token,o=null==a?void 0:a.output_cost_per_token,d=null==a?void 0:a.max_tokens,c=null==a?void 0:a.max_input_tokens),(null==t?void 0:t.litellm_params)&&(m=Object.fromEntries(Object.entries(null==t?void 0:t.litellm_params).filter(e=>{let[l]=e;return"model"!==l&&"api_base"!==l}))),h.data[e].provider=r,h.data[e].input_cost=i,h.data[e].output_cost=o,h.data[e].input_cost&&(h.data[e].input_cost=(1e6*Number(h.data[e].input_cost)).toFixed(2)),h.data[e].output_cost&&(h.data[e].output_cost=(1e6*Number(h.data[e].output_cost)).toFixed(2)),h.data[e].max_tokens=d,h.data[e].max_input_tokens=c,h.data[e].api_base=null==t?void 0:null===(s=t.litellm_params)||void 0===s?void 0:s.api_base,h.data[e].cleanedLitellmParams=m,lt.push(t.model_name),console.log(h.data[e])}if(c&&"Admin Viewer"==c){let{Title:e,Paragraph:l}=ee.default;return(0,a.jsxs)("div",{children:[(0,a.jsx)(e,{level:1,children:"Access Denied"}),(0,a.jsx)(l,{children:"Ask your proxy admin for access to view all models"})]})}let ln=e=>{console.log("received provider string: ".concat(e));let l=Object.keys(n).find(l=>n[l]===e);if(l){let e=eN[l];console.log("mappingResult: ".concat(e));let s=[];"object"==typeof N&&Object.entries(N).forEach(l=>{let[t,n]=l;null!==n&&"object"==typeof n&&"litellm_provider"in n&&(n.litellm_provider===e||n.litellm_provider.includes(e))&&s.push(t)}),W(s),console.log("providerModels: ".concat(G))}},la=async()=>{try{k.ZP.info("Running health check..."),el("");let e=await (0,u.EY)(o);el(e)}catch(e){console.error("Error running health check:",e),el("Error running health check")}},lr=async(e,l,s)=>{if(console.log("Updating model metrics for group:",e),o&&m&&c&&l&&s){console.log("inside updateModelMetrics - startTime:",l,"endTime:",s),eM(e);try{let t=await (0,u.o6)(o,m,c,e,l.toISOString(),s.toISOString());console.log("Model metrics response:",t),eK(t.data),eq(t.all_api_bases);let n=await (0,u.Rg)(o,e,l.toISOString(),s.toISOString());eV(n.data),eW(n.all_api_bases);let a=await (0,u.N8)(o,m,c,e,l.toISOString(),s.toISOString());console.log("Model exceptions response:",a),eY(a.data),e$(a.exception_types);let r=await (0,u.fP)(o,m,c,e,l.toISOString(),s.toISOString());console.log("slowResponses:",r),e1(r)}catch(e){console.error("Failed to fetch model metrics",e)}}},li=e=>{var l,s;let{payload:t,active:n}=e;if(!n||!t)return null;let r=null===(s=t[0])||void 0===s?void 0:null===(l=s.payload)||void 0===l?void 0:l.date,i=t.sort((e,l)=>l.value-e.value);if(i.length>5){let e=i.length-5;(i=i.slice(0,5)).push({dataKey:"".concat(e," other deployments"),value:t.slice(5).reduce((e,l)=>e+l.value,0),color:"gray"})}return(0,a.jsxs)("div",{className:"w-150 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown",children:[r&&(0,a.jsxs)("p",{className:"text-tremor-content-emphasis mb-2",children:["Date: ",r]}),i.map((e,l)=>{let s=parseFloat(e.value.toFixed(5)),t=0===s&&e.value>0?"<0.00001":s.toFixed(5);return(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("div",{className:"w-2 h-2 mt-1 rounded-full bg-".concat(e.color,"-500")}),(0,a.jsx)("p",{className:"text-tremor-content",children:e.dataKey})]}),(0,a.jsx)("p",{className:"font-medium text-tremor-content-emphasis text-righ ml-2",children:t})]},l)})]})};console.log("selectedProvider: ".concat($)),console.log("providerModels.length: ".concat(G.length));let lo=Object.keys(n).find(e=>n[e]===$);return lo&&(i=Y.find(e=>e.name===eN[lo])),(0,a.jsx)("div",{style:{width:"100%",height:"100%"},children:(0,a.jsxs)(en.Z,{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,a.jsxs)(ea.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)(et.Z,{children:"All Models"}),(0,a.jsx)(et.Z,{children:"Add Model"}),(0,a.jsx)(et.Z,{children:(0,a.jsx)("pre",{children:"/health Models"})}),(0,a.jsx)(et.Z,{children:"Model Analytics"}),(0,a.jsx)(et.Z,{children:"Model Retry Settings"})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[C&&(0,a.jsxs)(_.Z,{children:["Last Refreshed: ",C]}),(0,a.jsx)(M.Z,{icon:ej.Z,variant:"shadow",size:"xs",className:"self-center",onClick:ll})]})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsxs)(er.Z,{children:[(0,a.jsxs)(x.Z,{children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(_.Z,{children:"Filter by Public Model Name"}),(0,a.jsxs)(z.Z,{className:"mb-4 mt-2 ml-2 w-50",defaultValue:eF||eO[0],onValueChange:e=>eM("all"===e?"all":e),value:eF||eO[0],children:[(0,a.jsx)(V.Z,{value:"all",children:"All Models"}),eO.map((e,l)=>(0,a.jsx)(V.Z,{value:e,onClick:()=>eM(e),children:e},l))]})]}),(0,a.jsx)(F.Z,{children:(0,a.jsxs)(L.Z,{style:{maxWidth:"1500px",width:"100%"},children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{style:{maxWidth:"150px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:"Public Model Name"}),(0,a.jsx)(B.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:"Provider"}),"Admin"===c&&(0,a.jsx)(B.Z,{style:{maxWidth:"150px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:"API Base"}),(0,a.jsxs)(B.Z,{style:{maxWidth:"85px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:["Input Price"," ",(0,a.jsx)("p",{style:{fontSize:"10px",color:"gray"},children:"/1M Tokens ($)"})]}),(0,a.jsxs)(B.Z,{style:{maxWidth:"85px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:["Output Price"," ",(0,a.jsx)("p",{style:{fontSize:"10px",color:"gray"},children:"/1M Tokens ($)"})]}),(0,a.jsx)(B.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:Z?"Created At":(0,a.jsxs)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",style:{color:"#72bcd4"},children:[" ","✨ Created At"]})}),(0,a.jsx)(B.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:Z?"Created By":(0,a.jsxs)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",style:{color:"#72bcd4"},children:[" ","✨ Created By"]})}),(0,a.jsx)(B.Z,{style:{maxWidth:"50px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:"Status"}),(0,a.jsx)(B.Z,{})]})}),(0,a.jsx)(U.Z,{children:h.data.filter(e=>"all"===eF||e.model_name===eF||null==eF||""===eF).map((e,l)=>{var s;return(0,a.jsxs)(q.Z,{style:{maxHeight:"1px",minHeight:"1px"},children:[(0,a.jsx)(D.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:e.model_name||"-"})}),(0,a.jsx)(D.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:e.provider||"-"})}),"Admin"===c&&(0,a.jsx)(D.Z,{style:{maxWidth:"150px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsx)(eu.Z,{title:e&&e.api_base,children:(0,a.jsx)("pre",{style:{maxWidth:"150px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"10px"},title:e&&e.api_base?e.api_base:"",children:e&&e.api_base?e.api_base.slice(0,20):"-"})})}),(0,a.jsx)(D.Z,{style:{maxWidth:"80px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsx)("pre",{style:{fontSize:"10px"},children:e.input_cost?e.input_cost:e.litellm_params.input_cost_per_token?(1e6*Number(e.litellm_params.input_cost_per_token)).toFixed(2):null})}),(0,a.jsx)(D.Z,{style:{maxWidth:"80px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsx)("pre",{style:{fontSize:"10px"},children:e.output_cost?e.output_cost:e.litellm_params.output_cost_per_token?(1e6*Number(e.litellm_params.output_cost_per_token)).toFixed(2):null})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:Z&&((s=e.model_info.created_at)?new Date(s).toLocaleDateString("en-US"):null)||"-"})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:Z&&e.model_info.created_by||"-"})}),(0,a.jsx)(D.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word"},children:e.model_info.db_model?(0,a.jsx)(R.Z,{size:"xs",className:"text-white",children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:"DB Model"})}):(0,a.jsx)(R.Z,{size:"xs",className:"text-black",children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:"Config Model"})})}),(0,a.jsx)(D.Z,{style:{maxWidth:"150px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsxs)(x.Z,{numItems:3,children:[(0,a.jsx)(eh.Z,{children:(0,a.jsx)(M.Z,{icon:P.Z,size:"sm",onClick:()=>e9(e)})}),(0,a.jsx)(eh.Z,{children:(0,a.jsx)(M.Z,{icon:T.Z,size:"sm",onClick:()=>e7(e)})}),(0,a.jsx)(eh.Z,{children:(0,a.jsx)(eg,{modelID:e.model_info.id,accessToken:o})})]})})]},l)})})]})})]}),(0,a.jsx)(e=>{let{visible:l,onCancel:s,model:t,onSubmit:n}=e,[r]=S.Z.useForm(),i={},o="",d="";if(t){i=t.litellm_params,o=t.model_name;let e=t.model_info;e&&(d=e.id,console.log("model_id: ".concat(d)),i.model_id=d)}return(0,a.jsx)(w.Z,{title:"Edit Model "+o,visible:l,width:800,footer:null,onOk:()=>{r.validateFields().then(e=>{n(e),r.resetFields()}).catch(e=>{console.error("Validation failed:",e)})},onCancel:s,children:(0,a.jsxs)(S.Z,{form:r,onFinish:le,initialValues:i,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"api_base",name:"api_base",children:(0,a.jsx)(j.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"tpm",name:"tpm",tooltip:"int (optional) - Tokens limit for this deployment: in tokens per minute (tpm). Find this information on your model/providers website",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"rpm",name:"rpm",tooltip:"int (optional) - Rate limit for this deployment: in requests per minute (rpm). Find this information on your model/providers website",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"max_retries",name:"max_retries",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"timeout",name:"timeout",tooltip:"int (optional) - Timeout in seconds for LLM requests (Defaults to 600 seconds)",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"stream_timeout",name:"stream_timeout",tooltip:"int (optional) - Timeout for stream requests (seconds)",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"input_cost_per_token",name:"input_cost_per_token",tooltip:"float (optional) - Input cost per token",children:(0,a.jsx)(A.Z,{min:0,step:1e-4})}),(0,a.jsx)(S.Z.Item,{label:"output_cost_per_token",name:"output_cost_per_token",tooltip:"float (optional) - Output cost per token",children:(0,a.jsx)(A.Z,{min:0,step:1e-4})}),(0,a.jsx)(S.Z.Item,{label:"model_id",name:"model_id",hidden:!0})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Save"})})]})})},{visible:e_,onCancel:()=>{ey(!1),eT(null)},model:eP,onSubmit:le}),(0,a.jsxs)(w.Z,{title:eP&&eP.model_name,visible:eE,width:800,footer:null,onCancel:()=>{eC(!1),eT(null)},children:[(0,a.jsx)(y.Z,{children:"Model Info"}),(0,a.jsx)(eS.Z,{language:"json",children:eP&&JSON.stringify(eP,null,2)})]})]}),(0,a.jsxs)(er.Z,{className:"h-full",children:[(0,a.jsx)(ek,{level:2,children:"Add new model"}),(0,a.jsx)(F.Z,{children:(0,a.jsxs)(S.Z,{form:v,onFinish:()=>{v.validateFields().then(e=>{eI(e,o,v)}).catch(e=>{console.error("Validation failed:",e)})},labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.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,a.jsx)(z.Z,{value:$.toString(),children:H.map((e,l)=>(0,a.jsx)(V.Z,{value:e,onClick:()=>{ln(e),X(e)},children:e},l))})}),(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Public Model Name",name:"model_name",tooltip:"Model name your users will pass in. Also used for load-balancing, LiteLLM will load balance between all models with this public name.",className:"mb-0",children:(0,a.jsx)(j.Z,{placeholder:"Vertex AI (Anthropic, Gemini, etc.)"===(t=$.toString())?"gemini-pro":"Anthropic"==t?"claude-3-opus":"Amazon Bedrock"==t?"claude-3-opus":"Google AI Studio"==t?"gemini-pro":"gpt-3.5-turbo"})}),(0,a.jsxs)(ex.Z,{children:[(0,a.jsx)(eh.Z,{span:10}),(0,a.jsx)(eh.Z,{span:10,children:(0,a.jsx)(_.Z,{className:"mb-3 mt-1",children:"Model name your users will pass in."})})]}),(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"LiteLLM Model Name(s)",name:"model",tooltip:"Actual model name used for making litellm.completion() call.",className:"mb-0",children:"Azure"===$?(0,a.jsx)(j.Z,{placeholder:"Enter model name"}):G.length>0?(0,a.jsx)(eo.Z,{value:G,children:G.map((e,l)=>(0,a.jsx)(ed.Z,{value:e,children:e},l))}):(0,a.jsx)(j.Z,{placeholder:"gpt-3.5-turbo-0125"})}),(0,a.jsxs)(ex.Z,{children:[(0,a.jsx)(eh.Z,{span:10}),(0,a.jsx)(eh.Z,{span:10,children:(0,a.jsxs)(_.Z,{className:"mb-3 mt-1",children:["Actual model name used for making"," ",(0,a.jsx)(ew,{href:"https://docs.litellm.ai/docs/providers",target:"_blank",children:"litellm.completion() call"}),". We'll"," ",(0,a.jsx)(ew,{href:"https://docs.litellm.ai/docs/proxy/reliability#step-1---set-deployments-on-config",target:"_blank",children:"loadbalance"})," ","models with the same 'public name'"]})})]}),void 0!==i&&i.fields.length>0&&(0,a.jsx)(ev,{fields:i.fields,selectedProvider:i.name}),"Amazon Bedrock"!=$&&"Vertex AI (Anthropic, Gemini, etc.)"!=$&&(void 0===i||0==i.fields.length)&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"API Key",name:"api_key",children:(0,a.jsx)(j.Z,{placeholder:"sk-",type:"password"})}),"OpenAI"==$&&(0,a.jsx)(S.Z.Item,{label:"Organization ID",name:"organization_id",children:(0,a.jsx)(j.Z,{placeholder:"[OPTIONAL] my-unique-org"})}),"Vertex AI (Anthropic, Gemini, etc.)"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Vertex Project",name:"vertex_project",children:(0,a.jsx)(j.Z,{placeholder:"adroit-cadet-1234.."})}),"Vertex AI (Anthropic, Gemini, etc.)"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Vertex Location",name:"vertex_location",children:(0,a.jsx)(j.Z,{placeholder:"us-east-1"})}),"Vertex AI (Anthropic, Gemini, etc.)"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Vertex Credentials",name:"vertex_credentials",className:"mb-0",children:(0,a.jsx)(ef.Z,{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;v.setFieldsValue({vertex_credentials:l})}},l.readAsText(e)}return!1},onChange(e){"uploading"!==e.file.status&&console.log(e.file,e.fileList),"done"===e.file.status?k.ZP.success("".concat(e.file.name," file uploaded successfully")):"error"===e.file.status&&k.ZP.error("".concat(e.file.name," file upload failed."))},children:(0,a.jsx)(I.ZP,{icon:(0,a.jsx)(eZ.Z,{}),children:"Click to Upload"})})}),"Vertex AI (Anthropic, Gemini, etc.)"==$&&(0,a.jsxs)(ex.Z,{children:[(0,a.jsx)(eh.Z,{span:10}),(0,a.jsx)(eh.Z,{span:10,children:(0,a.jsx)(_.Z,{className:"mb-3 mt-1",children:"Give litellm a gcp service account(.json file), so it can make the relevant calls"})})]}),("Azure"==$||"OpenAI-Compatible Endpoints (Groq, Together AI, Mistral AI, etc.)"==$)&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"API Base",name:"api_base",children:(0,a.jsx)(j.Z,{placeholder:"https://..."})}),"Azure"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"API Version",name:"api_version",children:(0,a.jsx)(j.Z,{placeholder:"2023-07-01-preview"})}),"Azure"==$&&(0,a.jsxs)("div",{children:[(0,a.jsx)(S.Z.Item,{label:"Base Model",name:"base_model",className:"mb-0",children:(0,a.jsx)(j.Z,{placeholder:"azure/gpt-3.5-turbo"})}),(0,a.jsxs)(ex.Z,{children:[(0,a.jsx)(eh.Z,{span:10}),(0,a.jsx)(eh.Z,{span:10,children:(0,a.jsxs)(_.Z,{className:"mb-2",children:["The actual model your azure deployment uses. Used for accurate cost tracking. Select name from"," ",(0,a.jsx)(ew,{href:"https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json",target:"_blank",children:"here"})]})})]})]}),"Amazon Bedrock"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"AWS Access Key ID",name:"aws_access_key_id",tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`).",children:(0,a.jsx)(j.Z,{placeholder:""})}),"Amazon Bedrock"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"AWS Secret Access Key",name:"aws_secret_access_key",tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`).",children:(0,a.jsx)(j.Z,{placeholder:""})}),"Amazon Bedrock"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"AWS Region Name",name:"aws_region_name",tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`).",children:(0,a.jsx)(j.Z,{placeholder:"us-east-1"})}),(0,a.jsx)(S.Z.Item,{label:"LiteLLM Params",name:"litellm_extra_params",tooltip:"Optional litellm params used for making a litellm.completion() call.",className:"mb-0",children:(0,a.jsx)(ep.Z,{rows:4,placeholder:'{ "rpm": 100, "timeout": 0, "stream_timeout": 0 }'})}),(0,a.jsxs)(ex.Z,{children:[(0,a.jsx)(eh.Z,{span:10}),(0,a.jsx)(eh.Z,{span:10,children:(0,a.jsxs)(_.Z,{className:"mb-3 mt-1",children:["Pass JSON of litellm supported params"," ",(0,a.jsx)(ew,{href:"https://docs.litellm.ai/docs/completion/input",target:"_blank",children:"litellm.completion() call"})]})})]})]}),(0,a.jsx)("div",{style:{textAlign:"center",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Add Model"})}),(0,a.jsx)(eu.Z,{title:"Get help on our github",children:(0,a.jsx)(ee.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})})]})})]}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(_.Z,{children:"`/health` will run a very small request through your models configured on litellm"}),(0,a.jsx)(p.Z,{onClick:la,children:"Run `/health`"}),Q&&(0,a.jsx)("pre",{children:JSON.stringify(Q,null,2)})]})}),(0,a.jsxs)(er.Z,{children:[(0,a.jsxs)(x.Z,{numItems:2,className:"mt-2",children:[(0,a.jsxs)(eh.Z,{children:[(0,a.jsx)(_.Z,{children:"Select Time Range"}),(0,a.jsx)(es.Z,{enableSelect:!0,value:e2,onValueChange:e=>{e4(e),lr(eF,e.from,e.to)}})]}),(0,a.jsxs)(eh.Z,{children:[(0,a.jsx)(_.Z,{children:"Select Model Group"}),(0,a.jsx)(z.Z,{className:"mb-4 mt-2",defaultValue:eF||eO[0],value:eF||eO[0],children:eO.map((e,l)=>(0,a.jsx)(V.Z,{value:e,onClick:()=>lr(e,e2.from,e2.to),children:e},l))})]})]}),(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsx)(eh.Z,{children:(0,a.jsx)(F.Z,{className:"mr-2 max-h-[400px] min-h-[400px]",children:(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{variant:"line",defaultValue:"1",children:[(0,a.jsx)(et.Z,{value:"1",children:"Avg. Latency per Token"}),(0,a.jsx)(et.Z,{value:"2",children:"✨ Time to first token"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsxs)(er.Z,{children:[(0,a.jsx)("p",{className:"text-gray-500 italic",children:" (seconds/token)"}),(0,a.jsx)(_.Z,{className:"text-gray-500 italic mt-1 mb-1",children:"average Latency for successfull requests divided by the total tokens"}),eD&&eB&&(0,a.jsx)(ec.Z,{title:"Model Latency",className:"h-72",data:eD,showLegend:!1,index:"date",categories:eB,connectNulls:!0,customTooltip:li})]}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eb,{modelMetrics:ez,modelMetricsCategories:eG,customTooltip:li,premiumUser:Z})})]})]})})}),(0,a.jsx)(eh.Z,{children:(0,a.jsx)(F.Z,{className:"ml-2 max-h-[400px] min-h-[400px] overflow-y-auto",children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Deployment"}),(0,a.jsx)(B.Z,{children:"Success Responses"}),(0,a.jsxs)(B.Z,{children:["Slow Responses ",(0,a.jsx)("p",{children:"Success Responses taking 600+s"})]})]})}),(0,a.jsx)(U.Z,{children:e0.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.api_base}),(0,a.jsx)(D.Z,{children:e.total_count}),(0,a.jsx)(D.Z,{children:e.slow_count})]},l))})]})})})]}),(0,a.jsxs)(F.Z,{className:"mt-4",children:[(0,a.jsx)(y.Z,{children:"Exceptions per Model"}),(0,a.jsx)(em.Z,{className:"h-72",data:eH,index:"model",categories:eJ,stack:!0,yAxisWidth:30})]})]}),(0,a.jsxs)(er.Z,{children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(_.Z,{children:"Filter by Public Model Name"}),(0,a.jsx)(z.Z,{className:"mb-4 mt-2 ml-2 w-50",defaultValue:eF||eO[0],value:eF||eO[0],onValueChange:e=>eM(e),children:eO.map((e,l)=>(0,a.jsx)(V.Z,{value:e,onClick:()=>eM(e),children:e},l))})]}),(0,a.jsxs)(y.Z,{children:["Retry Policy for ",eF]}),(0,a.jsx)(_.Z,{className:"mb-6",children:"How many retries should be attempted based on the Exception"}),eA&&(0,a.jsx)("table",{children:(0,a.jsx)("tbody",{children:Object.entries(eA).map((e,l)=>{var s;let[t,n]=e,r=null==e5?void 0:null===(s=e5[eF])||void 0===s?void 0:s[n];return null==r&&(r=e3),(0,a.jsxs)("tr",{className:"flex justify-between items-center mt-2",children:[(0,a.jsx)("td",{children:(0,a.jsx)(_.Z,{children:t})}),(0,a.jsx)("td",{children:(0,a.jsx)(A.Z,{className:"ml-5",value:r,min:0,step:1,onChange:e=>{e8(l=>{var s;let t=null!==(s=null==l?void 0:l[eF])&&void 0!==s?s:{};return{...null!=l?l:{},[eF]:{...t,[n]:e}}})}})})]},l)})})}),(0,a.jsx)(p.Z,{className:"mt-6 mr-8",onClick:ls,children:"Save"})]})]})]})})};let{Option:eC}=v.default;var eP=e=>{let{userID:l,accessToken:s,teams:t}=e,[n]=S.Z.useForm(),[i,o]=(0,r.useState)(!1),[d,c]=(0,r.useState)(null),[m,h]=(0,r.useState)([]);(0,r.useEffect)(()=>{(async()=>{try{let e=await (0,u.So)(s,l,"any"),t=[];for(let l=0;l{o(!1),n.resetFields()},g=()=>{o(!1),c(null),n.resetFields()},Z=async e=>{try{k.ZP.info("Making API Call"),o(!0),console.log("formValues in create user:",e);let t=await (0,u.Ov)(s,null,e);console.log("user create Response:",t),c(t.key),k.ZP.success("API user Created"),n.resetFields(),localStorage.removeItem("userData"+l)}catch(e){console.error("Error creating the user:",e)}};return(0,a.jsxs)("div",{children:[(0,a.jsx)(p.Z,{className:"mx-auto mb-0",onClick:()=>o(!0),children:"+ Invite User"}),(0,a.jsxs)(w.Z,{title:"Invite User",visible:i,width:800,footer:null,onOk:x,onCancel:g,children:[(0,a.jsx)(_.Z,{className:"mb-1",children:"Invite a user to login to the Admin UI and create Keys"}),(0,a.jsx)(_.Z,{className:"mb-6",children:(0,a.jsx)("b",{children:"Note: SSO Setup Required for this"})}),(0,a.jsxs)(S.Z,{form:n,onFinish:Z,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsx)(S.Z.Item,{label:"User Email",name:"user_email",children:(0,a.jsx)(j.Z,{placeholder:""})}),(0,a.jsx)(S.Z.Item,{label:"Team ID",name:"team_id",children:(0,a.jsx)(v.default,{placeholder:"Select Team ID",style:{width:"100%"},children:t?t.map(e=>(0,a.jsx)(eC,{value:e.team_id,children:e.team_alias},e.team_id)):(0,a.jsx)(eC,{value:null,children:"Default Team"},"default")})}),(0,a.jsx)(S.Z.Item,{label:"Metadata",name:"metadata",children:(0,a.jsx)(N.Z.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Create User"})})]})]}),d&&(0,a.jsxs)(w.Z,{title:"User Created Successfully",visible:i,onOk:x,onCancel:g,footer:null,children:[(0,a.jsx)("p",{children:"User has been created to access your proxy. Please Ask them to Log In."}),(0,a.jsx)("br",{}),(0,a.jsx)("p",{children:(0,a.jsx)("b",{children:"Note: This Feature is only supported through SSO on the Admin UI"})})]})]})},eT=e=>{let{visible:l,onCancel:s,user:t,onSubmit:n}=e,[i,o]=(0,r.useState)(t),[d]=S.Z.useForm();(0,r.useEffect)(()=>{d.resetFields()},[t]);let c=async()=>{d.resetFields(),s()},m=async e=>{d.resetFields(),n(e),s()};return t?(0,a.jsx)(w.Z,{visible:l,onCancel:c,footer:null,title:"Edit User "+t.user_id,width:1e3,children:(0,a.jsx)(S.Z,{form:d,onFinish:m,initialValues:t,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"User Email",tooltip:"Email of the User",name:"user_email",children:(0,a.jsx)(j.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"user_id",name:"user_id",hidden:!0,children:(0,a.jsx)(j.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"User Role",name:"user_role",children:(0,a.jsxs)(v.default,{children:[(0,a.jsx)(v.default.Option,{value:"proxy_admin",children:"Proxy Admin (Can create, edit, delete keys, teams)"}),(0,a.jsx)(v.default.Option,{value:"proxy_admin_viewer",children:"Proxy Viewer (Can just view spend, cannot created keys, teams)"})]})}),(0,a.jsx)(S.Z.Item,{label:"Spend (USD)",name:"spend",tooltip:"(float) - Spend of all LLM calls completed by this user",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"User Budget (USD)",name:"max_budget",tooltip:"(float) - Maximum budget of this user",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Save"})})]})})}):null},eO=e=>{let{accessToken:l,token:s,keys:t,userRole:n,userID:i,teams:o,setKeys:d}=e,[c,m]=(0,r.useState)(null),[h,p]=(0,r.useState)(null),[j,g]=(0,r.useState)(0),[Z,f]=r.useState(null),[y,b]=(0,r.useState)(null),[v,S]=(0,r.useState)(!1),[k,w]=(0,r.useState)(null),N=async()=>{w(null),S(!1)},A=async e=>{console.log("inside handleEditSubmit:",e),l&&s&&n&&i&&((0,u.pf)(l,e,n),c&&m(c.map(l=>l.user_id===e.user_id?e:l)),w(null),S(!1))};return((0,r.useEffect)(()=>{if(!l||!s||!n||!i)return;let e=async()=>{try{let e=await (0,u.Br)(l,null,n,!0,j,25);console.log("user data response:",e),m(e)}catch(e){console.error("There was an error fetching the model data",e)}};l&&s&&n&&i&&e()},[l,s,n,i,j]),c&&l&&s&&n&&i)?(0,a.jsx)("div",{style:{width:"100%"},children:(0,a.jsxs)(x.Z,{className:"gap-2 p-2 h-[80vh] w-full mt-8",children:[(0,a.jsx)(eP,{userID:i,accessToken:l,teams:o}),(0,a.jsxs)(F.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[80vh] mb-4",children:[(0,a.jsx)("div",{className:"mb-4 mt-1",children:(0,a.jsx)(_.Z,{children:"These are Users on LiteLLM that created API Keys. Automatically tracked by LiteLLM"})}),(0,a.jsx)(en.Z,{children:(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsxs)(L.Z,{className:"mt-5",children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"User ID"}),(0,a.jsx)(B.Z,{children:"User Email"}),(0,a.jsx)(B.Z,{children:"User Models"}),(0,a.jsx)(B.Z,{children:"User Spend ($ USD)"}),(0,a.jsx)(B.Z,{children:"User Max Budget ($ USD)"}),(0,a.jsx)(B.Z,{children:"API Keys"}),(0,a.jsx)(B.Z,{})]})}),(0,a.jsx)(U.Z,{children:c.map(e=>{var l;return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.user_id}),(0,a.jsx)(D.Z,{children:e.user_email}),(0,a.jsx)(D.Z,{children:e.models&&e.models.length>0?e.models:"All Models"}),(0,a.jsx)(D.Z,{children:e.spend?null===(l=e.spend)||void 0===l?void 0:l.toFixed(2):0}),(0,a.jsx)(D.Z,{children:e.max_budget?e.max_budget:"Unlimited"}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(x.Z,{numItems:2,children:e&&e.key_aliases&&e.key_aliases.filter(e=>null!==e).length>0?(0,a.jsxs)(R.Z,{size:"xs",color:"indigo",children:[e.key_aliases.filter(e=>null!==e).length,"\xa0Keys"]}):(0,a.jsx)(R.Z,{size:"xs",color:"gray",children:"No Keys"})})}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(M.Z,{icon:P.Z,onClick:()=>{f(e.user_id),b(e)},children:"View Keys"}),(0,a.jsx)(M.Z,{icon:T.Z,onClick:()=>{w(e),S(!0)},children:"View Keys"}),(0,a.jsx)(M.Z,{icon:O.Z,onClick:()=>{f(e.user_id),b(e)},children:"View Keys"})]})]},e.user_id)})})]})}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsx)("div",{className:"flex-1 flex justify-between items-center"})]})})]})}),(0,a.jsx)(eT,{visible:v,onCancel:N,user:k,onSubmit:A})]}),function(){if(!c)return null;let e=Math.ceil(c.length/25);return(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsxs)("div",{children:["Showing Page ",j+1," of ",e]}),(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)("button",{className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-l focus:outline-none",disabled:0===j,onClick:()=>g(j-1),children:"← Prev"}),(0,a.jsx)("button",{className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-r focus:outline-none",onClick:()=>{g(j+1)},children:"Next →"})]})]})}()]})}):(0,a.jsx)("div",{children:"Loading..."})},eR=e=>{let{teams:l,searchParams:s,accessToken:t,setTeams:n,userID:i,userRole:o}=e,[d]=S.Z.useForm(),[c]=S.Z.useForm(),{Title:m,Paragraph:g}=ee.default,[Z,f]=(0,r.useState)(""),[y,b]=(0,r.useState)(!1),[E,C]=(0,r.useState)(l?l[0]:null),[P,G]=(0,r.useState)(!1),[W,H]=(0,r.useState)(!1),[Y,J]=(0,r.useState)([]),[$,X]=(0,r.useState)(!1),[Q,el]=(0,r.useState)(null),[es,et]=(0,r.useState)({}),en=e=>{C(e),b(!0)},ea=async e=>{let s=e.team_id;if(console.log("handleEditSubmit:",e),null==t)return;let a=await (0,u.Gh)(t,e);l&&n(l.map(e=>e.team_id===s?a.data:e)),k.ZP.success("Team updated successfully"),b(!1),C(null)},er=async e=>{el(e),X(!0)},ei=async()=>{if(null!=Q&&null!=l&&null!=t){try{await (0,u.rs)(t,Q);let e=l.filter(e=>e.team_id!==Q);n(e)}catch(e){console.error("Error deleting the team:",e)}X(!1),el(null)}};(0,r.useEffect)(()=>{let e=async()=>{try{if(null===i||null===o||null===t||null===l)return;console.log("fetching team info:");let e={};for(let s=0;s<(null==l?void 0:l.length);s++){let n=l[s].team_id,a=await (0,u.Xm)(t,n);console.log("teamInfo response:",a),null!==a&&(e={...e,[n]:a})}et(e)}catch(e){console.error("Error fetching team info:",e)}};(async()=>{try{if(null===i||null===o)return;if(null!==t){let e=(await (0,u.So)(t,i,o)).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,o,l]);let eo=async e=>{try{if(null!=t){var s;let a=null==e?void 0:e.team_alias;if((null!==(s=null==l?void 0:l.map(e=>e.team_alias))&&void 0!==s?s:[]).includes(a))throw Error("Team alias ".concat(a," already exists, please pick another alias"));k.ZP.info("Creating Team");let r=await (0,u.hT)(t,e);null!==l?n([...l,r]):n([r]),console.log("response for team create call: ".concat(r)),k.ZP.success("Team created"),G(!1)}}catch(e){console.error("Error creating the team:",e),k.ZP.error("Error creating the team: "+e,20)}},ed=async e=>{try{if(null!=t&&null!=l){k.ZP.info("Adding Member");let s={role:"user",user_email:e.user_email,user_id:e.user_id},a=await (0,u.cu)(t,E.team_id,s);console.log("response for team create call: ".concat(a.data));let r=l.findIndex(e=>(console.log("team.team_id=".concat(e.team_id,"; response.data.team_id=").concat(a.data.team_id)),e.team_id===a.data.team_id));if(console.log("foundIndex: ".concat(r)),-1!==r){let e=[...l];e[r]=a.data,n(e),C(a.data)}H(!1)}}catch(e){console.error("Error creating the team:",e)}};return console.log("received teams ".concat(JSON.stringify(l))),(0,a.jsx)("div",{className:"w-full mx-4",children:(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)(m,{level:4,children:"All Teams"}),(0,a.jsxs)(F.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:[(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Team Name"}),(0,a.jsx)(B.Z,{children:"Spend (USD)"}),(0,a.jsx)(B.Z,{children:"Budget (USD)"}),(0,a.jsx)(B.Z,{children:"Models"}),(0,a.jsx)(B.Z,{children:"TPM / RPM Limits"}),(0,a.jsx)(B.Z,{children:"Info"})]})}),(0,a.jsx)(U.Z,{children:l&&l.length>0?l.map(e=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.team_alias}),(0,a.jsx)(D.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.spend}),(0,a.jsx)(D.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.max_budget?e.max_budget:"No limit"}),(0,a.jsx)(D.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},children:Array.isArray(e.models)?(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:0===e.models.length?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Proxy Models"})}):e.models.map((e,l)=>"all-proxy-models"===e?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Proxy Models"})},l):(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,a.jsx)(_.Z,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},l))}):null}),(0,a.jsx)(D.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:(0,a.jsxs)(_.Z,{children:["TPM: ",e.tpm_limit?e.tpm_limit:"Unlimited"," ",(0,a.jsx)("br",{}),"RPM:"," ",e.rpm_limit?e.rpm_limit:"Unlimited"]})}),(0,a.jsxs)(D.Z,{children:[(0,a.jsxs)(_.Z,{children:[es&&e.team_id&&es[e.team_id]&&es[e.team_id].keys&&es[e.team_id].keys.length," ","Keys"]}),(0,a.jsxs)(_.Z,{children:[es&&e.team_id&&es[e.team_id]&&es[e.team_id].team_info&&es[e.team_id].team_info.members_with_roles&&es[e.team_id].team_info.members_with_roles.length," ","Members"]})]}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(M.Z,{icon:T.Z,size:"sm",onClick:()=>en(e)}),(0,a.jsx)(M.Z,{onClick:()=>er(e.team_id),icon:O.Z,size:"sm"})]})]},e.team_id)):null})]}),$&&(0,a.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,a.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,a.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,a.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,a.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,a.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,a.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,a.jsx)("div",{className:"sm:flex sm:items-start",children:(0,a.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,a.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Team"}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this team ?"})})]})})}),(0,a.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,a.jsx)(p.Z,{onClick:ei,color:"red",className:"ml-2",children:"Delete"}),(0,a.jsx)(p.Z,{onClick:()=>{X(!1),el(null)},children:"Cancel"})]})]})]})})]})]}),(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)(p.Z,{className:"mx-auto",onClick:()=>G(!0),children:"+ Create New Team"}),(0,a.jsx)(w.Z,{title:"Create Team",visible:P,width:800,footer:null,onOk:()=>{G(!1),d.resetFields()},onCancel:()=>{G(!1),d.resetFields()},children:(0,a.jsxs)(S.Z,{form:d,onFinish:eo,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,a.jsx)(j.Z,{placeholder:""})}),(0,a.jsx)(S.Z.Item,{label:"Models",name:"models",children:(0,a.jsxs)(v.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,a.jsx)(v.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),Y.map(e=>(0,a.jsx)(v.default.Option,{value:e,children:e},e))]})}),(0,a.jsx)(S.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(A.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,a.jsx)(A.Z,{step:1,width:400})}),(0,a.jsx)(S.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,a.jsx)(A.Z,{step:1,width:400})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Create Team"})})]})})]}),(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)(m,{level:4,children:"Team Members"}),(0,a.jsx)(g,{children:"If you belong to multiple teams, this setting controls which teams members you see."}),l&&l.length>0?(0,a.jsx)(z.Z,{defaultValue:"0",children:l.map((e,l)=>(0,a.jsx)(V.Z,{value:String(l),onClick:()=>{C(e)},children:e.team_alias},l))}):(0,a.jsxs)(g,{children:["No team created. ",(0,a.jsx)("b",{children:"Defaulting to personal account."})]})]}),(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)(F.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Member Name"}),(0,a.jsx)(B.Z,{children:"Role"})]})}),(0,a.jsx)(U.Z,{children:E?E.members_with_roles.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.user_email?e.user_email:e.user_id?e.user_id:null}),(0,a.jsx)(D.Z,{children:e.role})]},l)):null})]})}),E&&(0,a.jsx)(e=>{let{visible:l,onCancel:s,team:t,onSubmit:n}=e,[r]=S.Z.useForm();return(0,a.jsx)(w.Z,{title:"Edit Team",visible:l,width:800,footer:null,onOk:()=>{r.validateFields().then(e=>{n({...e,team_id:t.team_id}),r.resetFields()}).catch(e=>{console.error("Validation failed:",e)})},onCancel:s,children:(0,a.jsxs)(S.Z,{form:r,onFinish:ea,initialValues:t,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,a.jsx)(j.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"Models",name:"models",children:(0,a.jsxs)(v.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,a.jsx)(v.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),Y&&Y.map(e=>(0,a.jsx)(v.default.Option,{value:e,children:e},e))]})}),(0,a.jsx)(S.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(A.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,a.jsx)(A.Z,{step:1,width:400})}),(0,a.jsx)(S.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,a.jsx)(A.Z,{step:1,width:400})}),(0,a.jsx)(S.Z.Item,{label:"Requests per minute Limit (RPM)",name:"team_id",hidden:!0})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Edit Team"})})]})})},{visible:y,onCancel:()=>{b(!1),C(null)},team:E,onSubmit:ea})]}),(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)(p.Z,{className:"mx-auto mb-5",onClick:()=>H(!0),children:"+ Add member"}),(0,a.jsx)(w.Z,{title:"Add member",visible:W,width:800,footer:null,onOk:()=>{H(!1),c.resetFields()},onCancel:()=>{H(!1),c.resetFields()},children:(0,a.jsxs)(S.Z,{form:d,onFinish:ed,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Email",name:"user_email",className:"mb-4",children:(0,a.jsx)(N.Z,{name:"user_email",className:"px-3 py-2 border rounded-md w-full"})}),(0,a.jsx)("div",{className:"text-center mb-4",children:"OR"}),(0,a.jsx)(S.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,a.jsx)(N.Z,{name:"user_id",className:"px-3 py-2 border rounded-md w-full"})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Add member"})})]})})]})]})})},eF=e=>{let l,{searchParams:s,accessToken:t,showSSOBanner:n}=e,[i]=S.Z.useForm(),[o]=S.Z.useForm(),{Title:d,Paragraph:c}=ee.default,[m,j]=(0,r.useState)(""),[g,Z]=(0,r.useState)(null),[f,y]=(0,r.useState)(!1),[b,v]=(0,r.useState)(!1),[A,E]=(0,r.useState)(!1),[C,P]=(0,r.useState)(!1),[O,R]=(0,r.useState)(!1);try{l=window.location.origin}catch(e){l=""}l+="/fallback/login";let G=()=>{R(!1)},W=["proxy_admin","proxy_admin_viewer"];(0,r.useEffect)(()=>{(async()=>{if(null!=t){let e=[],l=await (0,u.Xd)(t,"proxy_admin_viewer");l.forEach(l=>{e.push({user_role:l.user_role,user_id:l.user_id,user_email:l.user_email})}),console.log("proxy viewers: ".concat(l));let s=await (0,u.Xd)(t,"proxy_admin");s.forEach(l=>{e.push({user_role:l.user_role,user_id:l.user_id,user_email:l.user_email})}),console.log("proxy admins: ".concat(s)),console.log("combinedList: ".concat(e)),Z(e)}})()},[t]);let H=()=>{E(!1),o.resetFields()},Y=()=>{E(!1),o.resetFields()},J=e=>(0,a.jsxs)(S.Z,{form:i,onFinish:e,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Email",name:"user_email",className:"mb-4",children:(0,a.jsx)(N.Z,{name:"user_email",className:"px-3 py-2 border rounded-md w-full"})}),(0,a.jsx)("div",{className:"text-center mb-4",children:"OR"}),(0,a.jsx)(S.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,a.jsx)(N.Z,{name:"user_id",className:"px-3 py-2 border rounded-md w-full"})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Add member"})})]}),$=(e,l,s)=>(0,a.jsxs)(S.Z,{form:i,onFinish:e,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"User Role",name:"user_role",labelCol:{span:10},labelAlign:"left",children:(0,a.jsx)(z.Z,{value:l,children:W.map((e,l)=>(0,a.jsx)(V.Z,{value:e,children:e},l))})}),(0,a.jsx)(S.Z.Item,{label:"Team ID",name:"user_id",hidden:!0,initialValue:s,valuePropName:"user_id",className:"mt-8",children:(0,a.jsx)(N.Z,{value:s,disabled:!0})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Update role"})})]}),X=async e=>{try{if(null!=t&&null!=g){k.ZP.info("Making API Call");let l=await (0,u.pf)(t,e,null);console.log("response for team create call: ".concat(l));let s=g.findIndex(e=>(console.log("user.user_id=".concat(e.user_id,"; response.user_id=").concat(l.user_id)),e.user_id===l.user_id));console.log("foundIndex: ".concat(s)),-1==s&&(console.log("updates admin with new user"),g.push(l),Z(g)),k.ZP.success("Refresh tab to see updated user role"),E(!1)}}catch(e){console.error("Error creating the key:",e)}},Q=async e=>{try{if(null!=t&&null!=g){k.ZP.info("Making API Call");let l=await (0,u.pf)(t,e,"proxy_admin_viewer");console.log("response for team create call: ".concat(l));let s=g.findIndex(e=>(console.log("user.user_id=".concat(e.user_id,"; response.user_id=").concat(l.user_id)),e.user_id===l.user_id));console.log("foundIndex: ".concat(s)),-1==s&&(console.log("updates admin with new user"),g.push(l),Z(g)),y(!1)}}catch(e){console.error("Error creating the key:",e)}},el=async e=>{try{if(null!=t&&null!=g){k.ZP.info("Making API Call"),e.user_email,e.user_id;let l=await (0,u.pf)(t,e,"proxy_admin");console.log("response for team create call: ".concat(l));let s=g.findIndex(e=>(console.log("user.user_id=".concat(e.user_id,"; response.user_id=").concat(l.user_id)),e.user_id===l.user_id));console.log("foundIndex: ".concat(s)),-1==s&&(console.log("updates admin with new user"),g.push(l),Z(g)),v(!1)}}catch(e){console.error("Error creating the key:",e)}},es=async e=>{if(null==t)return;let l={environment_variables:{PROXY_BASE_URL:e.proxy_base_url,GOOGLE_CLIENT_ID:e.google_client_id,GOOGLE_CLIENT_SECRET:e.google_client_secret}};(0,u.K_)(t,l)};return console.log("admins: ".concat(null==g?void 0:g.length)),(0,a.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,a.jsx)(d,{level:4,children:"Admin Access "}),(0,a.jsxs)(c,{children:[n&&(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/ui#restrict-ui-access",children:"Requires SSO Setup"}),(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Proxy Admin: "})," Can create keys, teams, users, add models, etc. ",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Proxy Admin Viewer: "}),"Can just view spend. They cannot create keys, teams or grant users access to new models."," "]}),(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 p-2 w-full",children:[(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsx)(F.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Member Name"}),(0,a.jsx)(B.Z,{children:"Role"})]})}),(0,a.jsx)(U.Z,{children:g?g.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.user_email?e.user_email:e.user_id?e.user_id:null}),(0,a.jsx)(D.Z,{children:e.user_role}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(M.Z,{icon:T.Z,size:"sm",onClick:()=>E(!0)}),(0,a.jsx)(w.Z,{title:"Update role",visible:A,width:800,footer:null,onOk:H,onCancel:Y,children:$(X,e.user_role,e.user_id)})]})]},l)):null})]})})}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)("div",{className:"flex justify-start",children:[(0,a.jsx)(p.Z,{className:"mr-4 mb-5",onClick:()=>v(!0),children:"+ Add admin"}),(0,a.jsx)(w.Z,{title:"Add admin",visible:b,width:800,footer:null,onOk:()=>{v(!1),o.resetFields()},onCancel:()=>{v(!1),o.resetFields()},children:J(el)}),(0,a.jsx)(p.Z,{className:"mb-5",onClick:()=>y(!0),children:"+ Add viewer"}),(0,a.jsx)(w.Z,{title:"Add viewer",visible:f,width:800,footer:null,onOk:()=>{y(!1),o.resetFields()},onCancel:()=>{y(!1),o.resetFields()},children:J(Q)})]})})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsx)(d,{level:4,children:"Add SSO"}),(0,a.jsxs)("div",{className:"flex justify-start mb-4",children:[(0,a.jsx)(p.Z,{onClick:()=>P(!0),children:"Add SSO"}),(0,a.jsx)(w.Z,{title:"Add SSO",visible:C,width:800,footer:null,onOk:()=>{P(!1),i.resetFields()},onCancel:()=>{P(!1),i.resetFields()},children:(0,a.jsxs)(S.Z,{form:i,onFinish:e=>{el(e),es(e),P(!1),R(!0)},labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Admin Email",name:"user_email",rules:[{required:!0,message:"Please enter the email of the proxy admin"}],children:(0,a.jsx)(N.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"PROXY BASE URL",name:"proxy_base_url",rules:[{required:!0,message:"Please enter the proxy base url"}],children:(0,a.jsx)(N.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"GOOGLE CLIENT ID",name:"google_client_id",rules:[{required:!0,message:"Please enter the google client id"}],children:(0,a.jsx)(N.Z.Password,{})}),(0,a.jsx)(S.Z.Item,{label:"GOOGLE CLIENT SECRET",name:"google_client_secret",rules:[{required:!0,message:"Please enter the google client secret"}],children:(0,a.jsx)(N.Z.Password,{})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Save"})})]})}),(0,a.jsxs)(w.Z,{title:"SSO Setup Instructions",visible:O,width:800,footer:null,onOk:G,onCancel:()=>{R(!1)},children:[(0,a.jsx)("p",{children:"Follow these steps to complete the SSO setup:"}),(0,a.jsx)(_.Z,{className:"mt-2",children:"1. DO NOT Exit this TAB"}),(0,a.jsx)(_.Z,{className:"mt-2",children:"2. Open a new tab, visit your proxy base url"}),(0,a.jsx)(_.Z,{className:"mt-2",children:"3. Confirm your SSO is configured correctly and you can login on the new Tab"}),(0,a.jsx)(_.Z,{className:"mt-2",children:"4. If Step 3 is successful, you can close this tab"}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{onClick:G,children:"Done"})})]})]}),(0,a.jsxs)(e_.Z,{title:"Login without SSO",color:"teal",children:["If you need to login without sso, you can access ",(0,a.jsxs)("a",{href:l,target:"_blank",children:[(0,a.jsx)("b",{children:l})," "]})]})]})]})},eM=s(42556),eL=s(90252),eU=e=>{let{alertingSettings:l,handleInputChange:s,handleResetField:t,handleSubmit:n,premiumUser:r}=e,[i]=S.Z.useForm();return(0,a.jsxs)(S.Z,{form:i,onFinish:()=>{let e=i.getFieldsValue();Object.values(e).some(e=>""===e||null==e)?console.log("Some form fields are empty."):n(e)},labelAlign:"left",children:[l.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsxs)(D.Z,{align:"center",children:[(0,a.jsx)(_.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)(D.Z,{children:"Integer"===e.field_type?(0,a.jsx)(A.Z,{step:1,value:e.field_value,onChange:l=>s(e.field_name,l)}):(0,a.jsx)(N.Z,{value:e.field_value,onChange:l=>s(e.field_name,l)})})}):(0,a.jsx)(D.Z,{children:(0,a.jsx)(p.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",children:(0,a.jsx)(D.Z,{children:"Integer"===e.field_type?(0,a.jsx)(A.Z,{step:1,value:e.field_value,onChange:l=>s(e.field_name,l),className:"p-0"}):(0,a.jsx)(N.Z,{value:e.field_value,onChange:l=>s(e.field_name,l)})})}),(0,a.jsx)(D.Z,{children:!0==e.stored_in_db?(0,a.jsx)(R.Z,{icon:eL.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,a.jsx)(R.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,a.jsx)(R.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(M.Z,{icon:O.Z,color:"red",onClick:()=>t(e.field_name,l),children:"Reset"})})]},l)),(0,a.jsx)("div",{children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Update Settings"})})]})},eD=e=>{let{accessToken:l,premiumUser:s}=e,[t,n]=(0,r.useState)([]);return console.log("INSIDE ALERTING SETTINGS"),(0,r.useEffect)(()=>{l&&(0,u.RQ)(l).then(e=>{n(e)})},[l]),(0,a.jsx)(eU,{alertingSettings:t,handleInputChange:(e,l)=>{n(t.map(s=>s.field_name===e?{...s,field_value:l}: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);console.log("INSIDE HANDLE RESET FIELD"),n(l)}catch(e){console.log("ERROR OCCURRED!")}},handleSubmit:e=>{if(!l||null==e||void 0==e)return;let s={};t.forEach(e=>{s[e.field_name]=e.field_value});let n={...e,...s};try{(0,u.jA)(l,"alerting_args",n),k.ZP.success("Wait 10s for proxy to update.")}catch(e){}},premiumUser:s})};let eK=[{name:"slack",variables:{LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:null,LANGFUSE_SECRET_KEY:null,OPENMETER_API_KEY:null,SLACK_WEBHOOK_URL:null}},{name:"langfuse",variables:{LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:null,LANGFUSE_SECRET_KEY:null,OPENMETER_API_KEY:null,SLACK_WEBHOOK_URL:null}},{name:"openmeter",variables:{LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:null,LANGFUSE_SECRET_KEY:null,OPENMETER_API_KEY:null,SLACK_WEBHOOK_URL:null}}];var eB=e=>{let{accessToken:l,userRole:s,userID:t,premiumUser:n}=e,[i,o]=(0,r.useState)(eK),[d,c]=(0,r.useState)([]),[m,h]=(0,r.useState)(!1),[g]=S.Z.useForm(),[Z,f]=(0,r.useState)(null),[b,N]=(0,r.useState)([]),[A,E]=(0,r.useState)(""),[C,P]=(0,r.useState)({}),[T,O]=(0,r.useState)([]),M=e=>{T.includes(e)?O(T.filter(l=>l!==e)):O([...T,e])},z={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,r.useEffect)(()=>{l&&s&&t&&(0,u.BL)(l,t,s).then(e=>{console.log("callbacks",e);let l=eK;o(l=l.map(l=>{let s=e.callbacks.find(e=>e.name===l.name);return s?{...l,variables:{...l.variables,...s.variables}}:l}));let s=e.alerts;if(console.log("alerts_data",s),s&&s.length>0){let e=s[0];console.log("_alert_info",e);let l=e.variables.SLACK_WEBHOOK_URL;console.log("catch_all_webhook",l),O(e.active_alerts),E(l),P(e.alerts_to_webhook)}c(s)})},[l,s,t]);let V=e=>T&&T.includes(e),G=()=>{if(!l)return;let e={};d.filter(e=>"email"===e.name).forEach(l=>{var s;Object.entries(null!==(s=l.variables)&&void 0!==s?s:{}).forEach(l=>{let[s,t]=l,n=document.querySelector('input[name="'.concat(s,'"]'));n&&n.value&&(e[s]=null==n?void 0:n.value)})}),console.log("updatedVariables",e);try{(0,u.K_)(l,{general_settings:{alerting:["email"]},environment_variables:e})}catch(e){k.ZP.error("Failed to update alerts: "+e,20)}k.ZP.success("Email settings updated successfully")},W=e=>{if(!l)return;let s=Object.fromEntries(Object.entries(e.variables).map(e=>{var l;let[s,t]=e;return[s,(null===(l=document.querySelector('input[name="'.concat(s,'"]')))||void 0===l?void 0:l.value)||t]}));console.log("updatedVariables",s),console.log("updateAlertTypes",b);let t={environment_variables:s,litellm_settings:{success_callback:[e.name]}};try{(0,u.K_)(l,t)}catch(e){k.ZP.error("Failed to update callback: "+e,20)}k.ZP.success("Callback updated successfully")},H=()=>{l&&g.validateFields().then(e=>{let s;if(console.log("Form values:",e),"langfuse"===e.callback){s={environment_variables:{LANGFUSE_PUBLIC_KEY:e.langfusePublicKey,LANGFUSE_SECRET_KEY:e.langfusePrivateKey},litellm_settings:{success_callback:[e.callback]}},(0,u.K_)(l,s);let t={name:e.callback,variables:{SLACK_WEBHOOK_URL:null,LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:e.langfusePublicKey,LANGFUSE_SECRET_KEY:e.langfusePrivateKey,OPENMETER_API_KEY:null}};o(i?[...i,t]:[t])}else if("slack"===e.callback){console.log("values.slackWebhookUrl: ".concat(e.slackWebhookUrl)),s={general_settings:{alerting:["slack"],alerting_threshold:300},environment_variables:{SLACK_WEBHOOK_URL:e.slackWebhookUrl}},(0,u.K_)(l,s),console.log("values.callback: ".concat(e.callback));let t={name:e.callback,variables:{SLACK_WEBHOOK_URL:e.slackWebhookUrl,LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:null,LANGFUSE_SECRET_KEY:null,OPENMETER_API_KEY:null}};o(i?[...i,t]:[t])}else if("openmeter"==e.callback){console.log("values.openMeterApiKey: ".concat(e.openMeterApiKey)),s={environment_variables:{OPENMETER_API_KEY:e.openMeterApiKey},litellm_settings:{success_callback:[e.callback]}},(0,u.K_)(l,s);let t={name:e.callback,variables:{SLACK_WEBHOOK_URL:null,LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:null,LANGFUSE_SECRET_KEY:null,OPENMETER_API_KEY:e.openMeterAPIKey}};o(i?[...i,t]:[t])}else s={error:"Invalid callback value"};h(!1),g.resetFields(),f(null)})};return l?(console.log("callbacks: ".concat(i)),(0,a.jsxs)("div",{className:"w-full mx-4",children:[(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:[(0,a.jsx)(e_.Z,{title:"[UI] Presidio PII + Guardrails Coming Soon. https://docs.litellm.ai/docs/proxy/pii_masking",color:"sky"}),(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{variant:"line",defaultValue:"1",children:[(0,a.jsx)(et.Z,{value:"1",children:"Logging Callbacks"}),(0,a.jsx)(et.Z,{value:"2",children:"Alerting Types"}),(0,a.jsx)(et.Z,{value:"3",children:"Alerting Settings"}),(0,a.jsx)(et.Z,{value:"4",children:"Email Alerts"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsx)(F.Z,{children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Callback"}),(0,a.jsx)(B.Z,{children:"Callback Env Vars"})]})}),(0,a.jsx)(U.Z,{children:i.filter(e=>"slack"!==e.name).map((e,s)=>{var t;return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:(0,a.jsx)(R.Z,{color:"emerald",children:e.name})}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)("ul",{children:Object.entries(null!==(t=e.variables)&&void 0!==t?t:{}).filter(l=>{let[s,t]=l;return s.toLowerCase().includes(e.name)}).map(e=>{let[l,s]=e;return(0,a.jsxs)("li",{children:[(0,a.jsx)(_.Z,{className:"mt-2",children:l}),"LANGFUSE_HOST"===l?(0,a.jsx)("p",{children:"default value=https://cloud.langfuse.com"}):(0,a.jsx)("div",{}),(0,a.jsx)(j.Z,{name:l,defaultValue:s,type:"password"})]},l)})}),(0,a.jsx)(p.Z,{className:"mt-2",onClick:()=>W(e),children:"Save Changes"}),(0,a.jsx)(p.Z,{onClick:()=>(0,u.jE)(l,e.name),className:"mx-2",children:"Test Callback"})]})]},s)})})]})})}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(F.Z,{children:[(0,a.jsxs)(_.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)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{}),(0,a.jsx)(B.Z,{}),(0,a.jsx)(B.Z,{children:"Slack Webhook URL"})]})}),(0,a.jsx)(U.Z,{children:Object.entries(z).map((e,l)=>{let[s,t]=e;return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:"region_outage_alerts"==s?n?(0,a.jsx)(eM.Z,{id:"switch",name:"switch",checked:V(s),onChange:()=>M(s)}):(0,a.jsx)(p.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)(eM.Z,{id:"switch",name:"switch",checked:V(s),onChange:()=>M(s)})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(_.Z,{children:t})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(j.Z,{name:s,type:"password",defaultValue:C&&C[s]?C[s]:A})})]},l)})})]}),(0,a.jsx)(p.Z,{size:"xs",className:"mt-2",onClick:()=>{if(!l)return;let e={};Object.entries(z).forEach(l=>{let[s,t]=l,n=document.querySelector('input[name="'.concat(s,'"]'));console.log("key",s),console.log("webhookInput",n);let a=(null==n?void 0:n.value)||"";console.log("newWebhookValue",a),e[s]=a}),console.log("updatedAlertToWebhooks",e);let s={general_settings:{alert_to_webhook_url:e,alert_types:T}};console.log("payload",s);try{(0,u.K_)(l,s)}catch(e){k.ZP.error("Failed to update alerts: "+e,20)}k.ZP.success("Alerts updated successfully")},children:"Save Changes"}),(0,a.jsx)(p.Z,{onClick:()=>(0,u.jE)(l,"slack"),className:"mx-2",children:"Test Alerts"})]})}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eD,{accessToken:l,premiumUser:n})}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Email Settings"}),(0,a.jsxs)(_.Z,{children:[(0,a.jsx)("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:d.filter(e=>"email"===e.name).map((e,l)=>{var s;return(0,a.jsx)(D.Z,{children:(0,a.jsx)("ul",{children:(0,a.jsx)(x.Z,{numItems:2,children:Object.entries(null!==(s=e.variables)&&void 0!==s?s:{}).map(e=>{let[l,s]=e;return(0,a.jsxs)("li",{className:"mx-2 my-2",children:[!0!=n&&("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)(_.Z,{className:"mt-2",children:[" ","✨ ",l]})}),(0,a.jsx)(j.Z,{name:l,defaultValue:s,type:"password",disabled:!0,style:{width:"400px"}})]}):(0,a.jsxs)("div",{children:[(0,a.jsx)(_.Z,{className:"mt-2",children:l}),(0,a.jsx)(j.Z,{name:l,defaultValue:s,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)(p.Z,{className:"mt-2",onClick:()=>G(),children:"Save Changes"}),(0,a.jsx)(p.Z,{onClick:()=>(0,u.jE)(l,"email"),className:"mx-2",children:"Test Email Alerts"})]})})]})]})]}),(0,a.jsx)(w.Z,{title:"Add Callback",visible:m,onOk:H,width:800,onCancel:()=>{h(!1),g.resetFields(),f(null)},footer:null,children:(0,a.jsxs)(S.Z,{form:g,layout:"vertical",onFinish:H,children:[(0,a.jsx)(S.Z.Item,{label:"Callback",name:"callback",rules:[{required:!0,message:"Please select a callback"}],children:(0,a.jsxs)(v.default,{onChange:e=>{f(e)},children:[(0,a.jsx)(v.default.Option,{value:"langfuse",children:"langfuse"}),(0,a.jsx)(v.default.Option,{value:"openmeter",children:"openmeter"})]})}),"langfuse"===Z&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"LANGFUSE_PUBLIC_KEY",name:"langfusePublicKey",rules:[{required:!0,message:"Please enter the public key"}],children:(0,a.jsx)(j.Z,{type:"password"})}),(0,a.jsx)(S.Z.Item,{label:"LANGFUSE_PRIVATE_KEY",name:"langfusePrivateKey",rules:[{required:!0,message:"Please enter the private key"}],children:(0,a.jsx)(j.Z,{type:"password"})})]}),"openmeter"==Z&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(S.Z.Item,{label:"OPENMETER_API_KEY",name:"openMeterApiKey",rules:[{required:!0,message:"Please enter the openmeter api key"}],children:(0,a.jsx)(j.Z,{type:"password"})})}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Save"})})]})})]})):null};let{Option:eq}=v.default;var ez=e=>{let{models:l,accessToken:s,routerSettings:t,setRouterSettings:n}=e,[i]=S.Z.useForm(),[o,d]=(0,r.useState)(!1),[c,m]=(0,r.useState)("");return(0,a.jsxs)("div",{children:[(0,a.jsx)(p.Z,{className:"mx-auto",onClick:()=>d(!0),children:"+ Add Fallbacks"}),(0,a.jsx)(w.Z,{title:"Add Fallbacks",visible:o,width:800,footer:null,onOk:()=>{d(!1),i.resetFields()},onCancel:()=>{d(!1),i.resetFields()},children:(0,a.jsxs)(S.Z,{form:i,onFinish:e=>{console.log(e);let{model_name:l,models:a}=e,r=[...t.fallbacks||[],{[l]:a}],o={...t,fallbacks:r};console.log(o);try{(0,u.K_)(s,{router_settings:o}),n(o)}catch(e){k.ZP.error("Failed to update router settings: "+e,20)}k.ZP.success("router settings updated successfully"),d(!1),i.resetFields()},labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Public Model Name",name:"model_name",rules:[{required:!0,message:"Set the model to fallback for"}],help:"required",children:(0,a.jsx)(z.Z,{defaultValue:c,children:l&&l.map((e,l)=>(0,a.jsx)(V.Z,{value:e,onClick:()=>m(e),children:e},l))})}),(0,a.jsx)(S.Z.Item,{label:"Fallback Models",name:"models",rules:[{required:!0,message:"Please select a model"}],help:"required",children:(0,a.jsx)(eo.Z,{value:l,children:l&&l.filter(e=>e!=c).map(e=>(0,a.jsx)(ed.Z,{value:e,children:e},e))})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Add Fallbacks"})})]})})]})},eV=s(12968);async function eG(e,l){console.log("isLocal:",!1);let s=window.location.origin,t=new eV.ZP.OpenAI({apiKey:l,baseURL:s,dangerouslyAllowBrowser:!0});try{let l=await t.chat.completions.create({model:e,messages:[{role:"user",content:"Hi, this is a test message"}],mock_testing_fallbacks:!0});k.ZP.success((0,a.jsxs)("span",{children:["Test model=",(0,a.jsx)("strong",{children:e}),", received model=",(0,a.jsx)("strong",{children:l.model}),". See"," ",(0,a.jsx)("a",{href:"#",onClick:()=>window.open("https://docs.litellm.ai/docs/proxy/reliability","_blank"),style:{textDecoration:"underline",color:"blue"},children:"curl"})]}))}catch(e){k.ZP.error("Error occurred while generating model response. Please try again. Error: ".concat(e),20)}}let eW={ttl:3600,lowest_latency_buffer:0},eH=e=>{let{selectedStrategy:l,strategyArgs:s,paramExplanation:t}=e;return(0,a.jsxs)(g.Z,{children:[(0,a.jsx)(f.Z,{className:"text-sm font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Routing Strategy Specific Args"}),(0,a.jsx)(Z.Z,{children:"latency-based-routing"==l?(0,a.jsx)(F.Z,{children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Setting"}),(0,a.jsx)(B.Z,{children:"Value"})]})}),(0,a.jsx)(U.Z,{children:Object.entries(s).map(e=>{let[l,s]=e;return(0,a.jsxs)(q.Z,{children:[(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(_.Z,{children:l}),(0,a.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:t[l]})]}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(j.Z,{name:l,defaultValue:"object"==typeof s?JSON.stringify(s,null,2):s.toString()})})]},l)})})]})}):(0,a.jsx)(_.Z,{children:"No specific settings"})})]})};var eY=e=>{let{accessToken:l,userRole:s,userID:t,modelData:n}=e,[i,o]=(0,r.useState)({}),[d,c]=(0,r.useState)({}),[m,g]=(0,r.useState)([]),[Z,f]=(0,r.useState)(!1),[b]=S.Z.useForm(),[v,w]=(0,r.useState)(null),[N,I]=(0,r.useState)(null),[E,C]=(0,r.useState)(null),P={routing_strategy_args:"(dict) Arguments to pass to the routing strategy",routing_strategy:"(string) Routing strategy to use",allowed_fails:"(int) Number of times a deployment can fail before being added to cooldown",cooldown_time:"(int) time in seconds to cooldown a deployment after failure",num_retries:"(int) Number of retries for failed requests. Defaults to 0.",timeout:"(float) Timeout for requests. Defaults to None.",retry_after:"(int) Minimum time to wait before retrying a failed request",ttl:"(int) Sliding window to look back over when calculating the average latency of a deployment. Default - 1 hour (in seconds).",lowest_latency_buffer:"(float) Shuffle between deployments within this % of the lowest latency. Default - 0 (i.e. always pick lowest latency)."};(0,r.useEffect)(()=>{l&&s&&t&&((0,u.BL)(l,t,s).then(e=>{console.log("callbacks",e),o(e.router_settings)}),(0,u.YU)(l).then(e=>{g(e)}))},[l,s,t]);let T=async e=>{if(l){console.log("received key: ".concat(e)),console.log("routerSettings['fallbacks']: ".concat(i.fallbacks)),i.fallbacks.map(l=>(e in l&&delete l[e],l));try{await (0,u.K_)(l,{router_settings:i}),o({...i}),I(i.routing_strategy),k.ZP.success("Router settings updated successfully")}catch(e){k.ZP.error("Failed to update router settings: "+e,20)}}},G=(e,l)=>{g(m.map(s=>s.field_name===e?{...s,field_value:l}:s))},W=(e,s)=>{if(!l)return;let t=m[s].field_value;if(null!=t&&void 0!=t)try{(0,u.jA)(l,e,t);let s=m.map(l=>l.field_name===e?{...l,stored_in_db:!0}:l);g(s)}catch(e){}},H=(e,s)=>{if(l)try{(0,u.ao)(l,e);let s=m.map(l=>l.field_name===e?{...l,stored_in_db:null,field_value:null}:l);g(s)}catch(e){}},Y=e=>{if(!l)return;console.log("router_settings",e);let s=Object.fromEntries(Object.entries(e).map(e=>{let[l,s]=e;if("routing_strategy_args"!==l&&"routing_strategy"!==l){var t;return[l,(null===(t=document.querySelector('input[name="'.concat(l,'"]')))||void 0===t?void 0:t.value)||s]}if("routing_strategy"==l)return[l,N];if("routing_strategy_args"==l&&"latency-based-routing"==N){let e={},l=document.querySelector('input[name="lowest_latency_buffer"]'),s=document.querySelector('input[name="ttl"]');return(null==l?void 0:l.value)&&(e.lowest_latency_buffer=Number(l.value)),(null==s?void 0:s.value)&&(e.ttl=Number(s.value)),console.log("setRoutingStrategyArgs: ".concat(e)),["routing_strategy_args",e]}return null}).filter(e=>null!=e));console.log("updatedVariables",s);try{(0,u.K_)(l,{router_settings:s})}catch(e){k.ZP.error("Failed to update router settings: "+e,20)}k.ZP.success("router settings updated successfully")};return l?(0,a.jsx)("div",{className:"w-full mx-4",children:(0,a.jsxs)(en.Z,{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,a.jsxs)(ea.Z,{variant:"line",defaultValue:"1",children:[(0,a.jsx)(et.Z,{value:"1",children:"Loadbalancing"}),(0,a.jsx)(et.Z,{value:"2",children:"Fallbacks"}),(0,a.jsx)(et.Z,{value:"3",children:"General"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:[(0,a.jsx)(y.Z,{children:"Router Settings"}),(0,a.jsxs)(F.Z,{children:[(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Setting"}),(0,a.jsx)(B.Z,{children:"Value"})]})}),(0,a.jsx)(U.Z,{children:Object.entries(i).filter(e=>{let[l,s]=e;return"fallbacks"!=l&&"context_window_fallbacks"!=l&&"routing_strategy_args"!=l}).map(e=>{let[l,s]=e;return(0,a.jsxs)(q.Z,{children:[(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(_.Z,{children:l}),(0,a.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:P[l]})]}),(0,a.jsx)(D.Z,{children:"routing_strategy"==l?(0,a.jsxs)(z.Z,{defaultValue:s,className:"w-full max-w-md",onValueChange:I,children:[(0,a.jsx)(V.Z,{value:"usage-based-routing",children:"usage-based-routing"}),(0,a.jsx)(V.Z,{value:"latency-based-routing",children:"latency-based-routing"}),(0,a.jsx)(V.Z,{value:"simple-shuffle",children:"simple-shuffle"})]}):(0,a.jsx)(j.Z,{name:l,defaultValue:"object"==typeof s?JSON.stringify(s,null,2):s.toString()})})]},l)})})]}),(0,a.jsx)(eH,{selectedStrategy:N,strategyArgs:i&&i.routing_strategy_args&&Object.keys(i.routing_strategy_args).length>0?i.routing_strategy_args:eW,paramExplanation:P})]}),(0,a.jsx)(h.Z,{children:(0,a.jsx)(p.Z,{className:"mt-2",onClick:()=>Y(i),children:"Save Changes"})})]})}),(0,a.jsxs)(er.Z,{children:[(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Model Name"}),(0,a.jsx)(B.Z,{children:"Fallbacks"})]})}),(0,a.jsx)(U.Z,{children:i.fallbacks&&i.fallbacks.map((e,s)=>Object.entries(e).map(e=>{let[t,n]=e;return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:t}),(0,a.jsx)(D.Z,{children:Array.isArray(n)?n.join(", "):n}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(p.Z,{onClick:()=>eG(t,l),children:"Test Fallback"})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(M.Z,{icon:O.Z,size:"sm",onClick:()=>T(t)})})]},s.toString()+t)}))})]}),(0,a.jsx)(ez,{models:(null==n?void 0:n.data)?n.data.map(e=>e.model_name):[],accessToken:l,routerSettings:i,setRouterSettings:o})]}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(F.Z,{children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Setting"}),(0,a.jsx)(B.Z,{children:"Value"}),(0,a.jsx)(B.Z,{children:"Status"}),(0,a.jsx)(B.Z,{children:"Action"})]})}),(0,a.jsx)(U.Z,{children:m.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(_.Z,{children:e.field_name}),(0,a.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:e.field_description})]}),(0,a.jsx)(D.Z,{children:"Integer"==e.field_type?(0,a.jsx)(A.Z,{step:1,value:e.field_value,onChange:l=>G(e.field_name,l)}):null}),(0,a.jsx)(D.Z,{children:!0==e.stored_in_db?(0,a.jsx)(R.Z,{icon:eL.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,a.jsx)(R.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,a.jsx)(R.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(p.Z,{onClick:()=>W(e.field_name,l),children:"Update"}),(0,a.jsx)(M.Z,{icon:O.Z,color:"red",onClick:()=>H(e.field_name,l),children:"Reset"})]})]},l))})]})})})]})]})}):null},eJ=e=>{let{isModalVisible:l,accessToken:s,setIsModalVisible:t,setBudgetList:n}=e,[r]=S.Z.useForm(),i=async e=>{if(null!=s&&void 0!=s)try{k.ZP.info("Making API Call");let l=await (0,u.Zr)(s,e);console.log("key create Response:",l),n(e=>e?[...e,l]:[l]),k.ZP.success("API Key Created"),r.resetFields()}catch(e){console.error("Error creating the key:",e),k.ZP.error("Error creating the key: ".concat(e),20)}};return(0,a.jsx)(w.Z,{title:"Create Budget",visible:l,width:800,footer:null,onOk:()=>{t(!1),r.resetFields()},onCancel:()=>{t(!1),r.resetFields()},children:(0,a.jsxs)(S.Z,{form:r,onFinish:i,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Budget ID",name:"budget_id",rules:[{required:!0,message:"Please input a human-friendly name for the budget"}],help:"A human-friendly name for the budget",children:(0,a.jsx)(j.Z,{placeholder:""})}),(0,a.jsx)(S.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,a.jsx)(A.Z,{step:1,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,a.jsx)(A.Z,{step:1,precision:2,width:200})}),(0,a.jsxs)(g.Z,{className:"mt-20 mb-8",children:[(0,a.jsx)(f.Z,{children:(0,a.jsx)("b",{children:"Optional Settings"})}),(0,a.jsxs)(Z.Z,{children:[(0,a.jsx)(S.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(A.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,a.jsxs)(v.default,{defaultValue:null,placeholder:"n/a",children:[(0,a.jsx)(v.default.Option,{value:"24h",children:"daily"}),(0,a.jsx)(v.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Create Budget"})})]})})},e$=e=>{let{accessToken:l}=e,[s,t]=(0,r.useState)(!1),[n,i]=(0,r.useState)([]);(0,r.useEffect)(()=>{l&&(0,u.O3)(l).then(e=>{i(e)})},[l]);let o=async(e,s)=>{if(null==l)return;k.ZP.info("Request made"),await (0,u.NV)(l,e);let t=[...n];t.splice(s,1),i(t),k.ZP.success("Budget Deleted.")};return(0,a.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,a.jsx)(p.Z,{size:"sm",variant:"primary",className:"mb-2",onClick:()=>t(!0),children:"+ Create Budget"}),(0,a.jsx)(eJ,{accessToken:l,isModalVisible:s,setIsModalVisible:t,setBudgetList:i}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(_.Z,{children:"Create a budget to assign to customers."}),(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Budget ID"}),(0,a.jsx)(B.Z,{children:"Max Budget"}),(0,a.jsx)(B.Z,{children:"TPM"}),(0,a.jsx)(B.Z,{children:"RPM"})]})}),(0,a.jsx)(U.Z,{children:n.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.budget_id}),(0,a.jsx)(D.Z,{children:e.max_budget?e.max_budget:"n/a"}),(0,a.jsx)(D.Z,{children:e.tpm_limit?e.tpm_limit:"n/a"}),(0,a.jsx)(D.Z,{children:e.rpm_limit?e.rpm_limit:"n/a"}),(0,a.jsx)(M.Z,{icon:O.Z,size:"sm",onClick:()=>o(e.budget_id,l)})]},l))})]})]}),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)(_.Z,{className:"text-base",children:"How to use budget id"}),(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{children:[(0,a.jsx)(et.Z,{children:"Assign Budget to Customer"}),(0,a.jsx)(et.Z,{children:"Test it (Curl)"}),(0,a.jsx)(et.Z,{children:"Test it (OpenAI SDK)"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"bash",children:"\ncurl -X POST --location '/end_user/new' \n-H 'Authorization: Bearer ' \n-H 'Content-Type: application/json' \n-d '{\"user_id\": \"my-customer-id', \"budget_id\": \"\"}' # \uD83D\uDC48 KEY CHANGE\n\n "})}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"bash",children:'\ncurl -X POST --location \'/chat/completions\' \n-H \'Authorization: Bearer \' \n-H \'Content-Type: application/json\' \n-d \'{\n "model": "gpt-3.5-turbo\', \n "messages":[{"role": "user", "content": "Hey, how\'s it going?"}],\n "user": "my-customer-id"\n}\' # \uD83D\uDC48 KEY CHANGE\n\n '})}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"python",children:'from openai import OpenAI\nclient = OpenAI(\n base_url="{let{}=e;return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(x.Z,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,a.jsxs)("div",{className:"mb-5",children:[(0,a.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:"OpenAI Compatible Proxy: API Reference"}),(0,a.jsx)(_.Z,{className:"mt-2 mb-2",children:"LiteLLM is OpenAI Compatible. This means your API Key works with the OpenAI SDK. Just replace the base_url to point to your litellm proxy. Example Below "}),(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{children:[(0,a.jsx)(et.Z,{children:"OpenAI Python SDK"}),(0,a.jsx)(et.Z,{children:"LlamaIndex"}),(0,a.jsx)(et.Z,{children:"Langchain Py"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"python",children:'\nimport openai\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="http://0.0.0.0:4000" # LiteLLM Proxy is OpenAI compatible, Read More: https://docs.litellm.ai/docs/proxy/user_keys\n)\n\nresponse = client.chat.completions.create(\n model="gpt-3.5-turbo", # model to send to the proxy\n messages = [\n {\n "role": "user",\n "content": "this is a test request, write a short poem"\n }\n ]\n)\n\nprint(response)\n '})}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"python",children:'\nimport os, dotenv\n\nfrom llama_index.llms import AzureOpenAI\nfrom llama_index.embeddings import AzureOpenAIEmbedding\nfrom llama_index import VectorStoreIndex, SimpleDirectoryReader, ServiceContext\n\nllm = AzureOpenAI(\n engine="azure-gpt-3.5", # model_name on litellm proxy\n temperature=0.0,\n azure_endpoint="http://0.0.0.0:4000", # litellm proxy endpoint\n api_key="sk-1234", # litellm proxy API Key\n api_version="2023-07-01-preview",\n)\n\nembed_model = AzureOpenAIEmbedding(\n deployment_name="azure-embedding-model",\n azure_endpoint="http://0.0.0.0:4000",\n api_key="sk-1234",\n api_version="2023-07-01-preview",\n)\n\n\ndocuments = SimpleDirectoryReader("llama_index_data").load_data()\nservice_context = ServiceContext.from_defaults(llm=llm, embed_model=embed_model)\nindex = VectorStoreIndex.from_documents(documents, service_context=service_context)\n\nquery_engine = index.as_query_engine()\nresponse = query_engine.query("What did the author do growing up?")\nprint(response)\n\n '})}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"python",children:'\nfrom langchain.chat_models import ChatOpenAI\nfrom langchain.prompts.chat import (\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n SystemMessagePromptTemplate,\n)\nfrom langchain.schema import HumanMessage, SystemMessage\n\nchat = ChatOpenAI(\n openai_api_base="http://0.0.0.0:4000",\n model = "gpt-3.5-turbo",\n temperature=0.1\n)\n\nmessages = [\n SystemMessage(\n content="You are a helpful assistant that im using to make a test request to."\n ),\n HumanMessage(\n content="test from litellm. tell me why it\'s amazing in 1 sentence"\n ),\n]\nresponse = chat(messages)\n\nprint(response)\n\n '})})]})]})]})})})};async function e0(e,l,s,t){console.log("isLocal:",!1);let n=window.location.origin,a=new eV.ZP.OpenAI({apiKey:t,baseURL:n,dangerouslyAllowBrowser:!0});try{for await(let t of(await a.chat.completions.create({model:s,stream:!0,messages:[{role:"user",content:e}]})))console.log(t),t.choices[0].delta.content&&l(t.choices[0].delta.content)}catch(e){k.ZP.error("Error occurred while generating model response. Please try again. Error: ".concat(e),20)}}var e1=e=>{let{accessToken:l,token:s,userRole:t,userID:n}=e,[i,o]=(0,r.useState)(""),[d,c]=(0,r.useState)(""),[m,g]=(0,r.useState)([]),[Z,f]=(0,r.useState)(void 0),[y,b]=(0,r.useState)([]);(0,r.useEffect)(()=>{l&&s&&t&&n&&(async()=>{try{let e=await (0,u.So)(l,n,t);if(console.log("model_info:",e),(null==e?void 0:e.data.length)>0){let l=e.data.map(e=>({value:e.id,label:e.id}));console.log(l),b(l),f(e.data[0].id)}}catch(e){console.error("Error fetching model info:",e)}})()},[l,n,t]);let S=(e,l)=>{g(s=>{let t=s[s.length-1];return t&&t.role===e?[...s.slice(0,s.length-1),{role:e,content:t.content+l}]:[...s,{role:e,content:l}]})},k=async()=>{if(""!==d.trim()&&i&&s&&t&&n){g(e=>[...e,{role:"user",content:d}]);try{Z&&await e0(d,e=>S("assistant",e),Z,i)}catch(e){console.error("Error fetching model response",e),S("assistant","Error fetching model response")}c("")}};if(t&&"Admin Viewer"==t){let{Title:e,Paragraph:l}=ee.default;return(0,a.jsxs)("div",{children:[(0,a.jsx)(e,{level:1,children:"Access Denied"}),(0,a.jsx)(l,{children:"Ask your proxy admin for access to test models"})]})}return(0,a.jsx)("div",{style:{width:"100%",position:"relative"},children:(0,a.jsx)(x.Z,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,a.jsx)(F.Z,{children:(0,a.jsxs)(en.Z,{children:[(0,a.jsx)(ea.Z,{children:(0,a.jsx)(et.Z,{children:"Chat"})}),(0,a.jsx)(ei.Z,{children:(0,a.jsxs)(er.Z,{children:[(0,a.jsx)("div",{className:"sm:max-w-2xl",children:(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(_.Z,{children:"API Key"}),(0,a.jsx)(j.Z,{placeholder:"Type API Key here",type:"password",onValueChange:o,value:i})]}),(0,a.jsxs)(h.Z,{className:"mx-2",children:[(0,a.jsx)(_.Z,{children:"Select Model:"}),(0,a.jsx)(v.default,{placeholder:"Select a Model",onChange:e=>{console.log("selected ".concat(e)),f(e)},options:y,style:{width:"200px"}})]})]})}),(0,a.jsxs)(L.Z,{className:"mt-5",style:{display:"block",maxHeight:"60vh",overflowY:"auto"},children:[(0,a.jsx)(K.Z,{children:(0,a.jsx)(q.Z,{children:(0,a.jsx)(D.Z,{})})}),(0,a.jsx)(U.Z,{children:m.map((e,l)=>(0,a.jsx)(q.Z,{children:(0,a.jsx)(D.Z,{children:"".concat(e.role,": ").concat(e.content)})},l))})]}),(0,a.jsx)("div",{className:"mt-3",style:{position:"absolute",bottom:5,width:"95%"},children:(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)(j.Z,{type:"text",value:d,onChange:e=>c(e.target.value),placeholder:"Type your message..."}),(0,a.jsx)(p.Z,{onClick:k,className:"ml-2",children:"Send"})]})})]})})]})})})})},e2=s(33509),e4=s(95781);let{Sider:e5}=e2.default;var e8=e=>{let{setPage:l,userRole:s,defaultSelectedKey:t}=e;return"Admin Viewer"==s?(0,a.jsx)(e2.default,{style:{minHeight:"100vh",maxWidth:"120px"},children:(0,a.jsx)(e5,{width:120,children:(0,a.jsxs)(e4.Z,{mode:"inline",defaultSelectedKeys:t||["4"],style:{height:"100%",borderRight:0},children:[(0,a.jsx)(e4.Z.Item,{onClick:()=>l("api-keys"),children:"API Keys"},"4"),(0,a.jsx)(e4.Z.Item,{onClick:()=>l("models"),children:"Models"},"2"),(0,a.jsx)(e4.Z.Item,{onClick:()=>l("llm-playground"),children:"Chat UI"},"3"),(0,a.jsx)(e4.Z.Item,{onClick:()=>l("usage"),children:"Usage"},"1")]})})}):(0,a.jsx)(e2.default,{style:{minHeight:"100vh",maxWidth:"145px"},children:(0,a.jsx)(e5,{width:145,children:(0,a.jsxs)(e4.Z,{mode:"inline",defaultSelectedKeys:t||["1"],style:{height:"100%",borderRight:0},children:[(0,a.jsx)(e4.Z.Item,{onClick:()=>l("api-keys"),children:(0,a.jsx)(_.Z,{children:"API Keys"})},"1"),(0,a.jsx)(e4.Z.Item,{onClick:()=>l("llm-playground"),children:(0,a.jsx)(_.Z,{children:"Test Key"})},"3"),"Admin"==s?(0,a.jsx)(e4.Z.Item,{onClick:()=>l("models"),children:(0,a.jsx)(_.Z,{children:"Models"})},"2"):null,"Admin"==s?(0,a.jsx)(e4.Z.Item,{onClick:()=>l("usage"),children:(0,a.jsx)(_.Z,{children:"Usage"})},"4"):null,"Admin"==s?(0,a.jsx)(e4.Z.Item,{onClick:()=>l("teams"),children:(0,a.jsx)(_.Z,{children:"Teams"})},"6"):null,"Admin"==s?(0,a.jsx)(e4.Z.Item,{onClick:()=>l("users"),children:(0,a.jsx)(_.Z,{children:"Internal Users"})},"5"):null,"Admin"==s?(0,a.jsx)(e4.Z.Item,{onClick:()=>l("settings"),children:(0,a.jsx)(_.Z,{children:"Logging & Alerts"})},"8"):null,"Admin"==s?(0,a.jsx)(e4.Z.Item,{onClick:()=>l("budgets"),children:(0,a.jsx)(_.Z,{children:"Budgets"})},"9"):null,"Admin"==s?(0,a.jsx)(e4.Z.Item,{onClick:()=>l("general-settings"),children:(0,a.jsx)(_.Z,{children:"Router Settings"})},"10"):null,"Admin"==s?(0,a.jsx)(e4.Z.Item,{onClick:()=>l("admin-panel"),children:(0,a.jsx)(_.Z,{children:"Admin"})},"11"):null,(0,a.jsx)(e4.Z.Item,{onClick:()=>l("api_ref"),children:(0,a.jsx)(_.Z,{children:"API Reference"})},"12"),(0,a.jsx)(e4.Z.Item,{onClick:()=>l("model-hub"),children:(0,a.jsx)(_.Z,{children:"Model Hub"})},"14")]})})})},e3=s(67989),e6=s(49167),e7=s(52703),e9=e=>{let{accessToken:l,token:s,userRole:t,userID:n,keys:i,premiumUser:o}=e,d=new Date,[c,m]=(0,r.useState)([]),[j,g]=(0,r.useState)([]),[Z,f]=(0,r.useState)([]),[b,v]=(0,r.useState)([]),[S,k]=(0,r.useState)([]),[w,N]=(0,r.useState)([]),[A,I]=(0,r.useState)([]),[E,C]=(0,r.useState)([]),[P,T]=(0,r.useState)([]),[O,R]=(0,r.useState)({}),[M,G]=(0,r.useState)([]),[W,H]=(0,r.useState)(""),[Y,$]=(0,r.useState)({from:new Date(Date.now()-6048e5),to:new Date}),X=new Date(d.getFullYear(),d.getMonth(),1),Q=new Date(d.getFullYear(),d.getMonth()+1,0),ee=eh(X),el=eh(Q);function eo(e){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0,notation:"compact",compactDisplay:"short"}).format(e)}console.log("keys in usage",i),console.log("premium user in usage",o);let ed=async(e,s,t)=>{if(!e||!s||!l)return;s.setHours(23,59,59,999),e.setHours(0,0,0,0),console.log("uiSelectedKey",t);let n=await (0,u.b1)(l,t,e.toISOString(),s.toISOString());console.log("End user data updated successfully",n),v(n)},eu=async(e,s)=>{e&&s&&l&&(s.setHours(23,59,59,999),e.setHours(0,0,0,0),N((await (0,u.J$)(l,e.toISOString(),s.toISOString())).spend_per_tag),console.log("Tag spend data updated successfully"))};function eh(e){let l=e.getFullYear(),s=e.getMonth()+1,t=e.getDate();return"".concat(l,"-").concat(s<10?"0"+s:s,"-").concat(t<10?"0"+t:t)}return console.log("Start date is ".concat(ee)),console.log("End date is ".concat(el)),(0,r.useEffect)(()=>{l&&s&&t&&n&&(async()=>{try{if(console.log("user role: ".concat(t)),"Admin"==t||"Admin Viewer"==t){var e,a;let t=await (0,u.FC)(l);m(t);let n=await (0,u.OU)(l,s,ee,el);console.log("provider_spend",n),T(n);let r=(await (0,u.tN)(l)).map(e=>({key:(e.key_alias||e.key_name||e.api_key).substring(0,10),spend:e.total_spend}));g(r);let i=(await (0,u.Au)(l)).map(e=>({key:e.model,spend:e.total_spend}));f(i);let o=await (0,u.mR)(l);console.log("teamSpend",o),k(o.daily_spend),I(o.teams);let d=o.total_spend_per_team;d=d.map(e=>(e.name=e.team_id||"",e.value=e.total_spend||0,e.value=e.value.toFixed(2),e)),C(d);let c=await (0,u.J$)(l,null===(e=Y.from)||void 0===e?void 0:e.toISOString(),null===(a=Y.to)||void 0===a?void 0:a.toISOString());N(c.spend_per_tag);let h=await (0,u.b1)(l,null,void 0,void 0);v(h),console.log("spend/user result",h);let x=await (0,u.wd)(l,ee,el);R(x);let p=await (0,u.xA)(l,ee,el);console.log("global activity per model",p),G(p)}else"App Owner"==t&&await (0,u.HK)(l,s,t,n,ee,el).then(async e=>{if(console.log("result from spend logs call",e),"daily_spend"in e){let l=e.daily_spend;console.log("daily spend",l),m(l);let s=e.top_api_keys;g(s)}else{let s=(await (0,u.e2)(l,function(e){let l=[];e.forEach(e=>{Object.entries(e).forEach(e=>{let[s,t]=e;"spend"!==s&&"startTime"!==s&&"models"!==s&&"users"!==s&&l.push({key:s,spend:t})})}),l.sort((e,l)=>Number(l.spend)-Number(e.spend));let s=l.slice(0,5).map(e=>e.key);return console.log("topKeys: ".concat(Object.keys(s[0]))),s}(e))).info.map(e=>({key:(e.key_name||e.key_alias).substring(0,10),spend:e.spend}));g(s),m(e)}})}catch(e){console.error("There was an error fetching the data",e)}})()},[l,s,t,n,ee,el]),(0,a.jsxs)("div",{style:{width:"100%"},className:"p-8",children:[(0,a.jsx)(J,{userID:n,userRole:t,accessToken:l,userSpend:null,selectedTeam:null}),(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{className:"mt-2",children:[(0,a.jsx)(et.Z,{children:"All Up"}),(0,a.jsx)(et.Z,{children:"Team Based Usage"}),(0,a.jsx)(et.Z,{children:"End User Usage"}),(0,a.jsx)(et.Z,{children:"Tag Based Usage"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{variant:"solid",className:"mt-1",children:[(0,a.jsx)(et.Z,{children:"Cost"}),(0,a.jsx)(et.Z,{children:"Activity"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsxs)(x.Z,{numItems:2,className:"gap-2 h-[100vh] w-full",children:[(0,a.jsx)(h.Z,{numColSpan:2,children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Monthly Spend"}),(0,a.jsx)(em.Z,{data:c,index:"date",categories:["spend"],colors:["blue"],valueFormatter:e=>"$ ".concat(new Intl.NumberFormat("us").format(e).toString()),yAxisWidth:100,tickGap:5})]})}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Top API Keys"}),(0,a.jsx)(em.Z,{className:"mt-4 h-40",data:j,index:"key",categories:["spend"],colors:["blue"],yAxisWidth:80,tickGap:5,layout:"vertical",showXAxis:!1,showLegend:!1})]})}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Top Models"}),(0,a.jsx)(em.Z,{className:"mt-4 h-40",data:Z,index:"key",categories:["spend"],colors:["blue"],yAxisWidth:200,layout:"vertical",showXAxis:!1,showLegend:!1})]})}),(0,a.jsx)(h.Z,{numColSpan:1}),(0,a.jsx)(h.Z,{numColSpan:2,children:(0,a.jsxs)(F.Z,{className:"mb-2",children:[(0,a.jsx)(y.Z,{children:"✨ Spend by Provider"}),o?(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsx)(e7.Z,{className:"mt-4 h-40",variant:"pie",data:P,index:"provider",category:"spend"})}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Provider"}),(0,a.jsx)(B.Z,{children:"Spend"})]})}),(0,a.jsx)(U.Z,{children:P.map(e=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.provider}),(0,a.jsx)(D.Z,{children:1e-5>parseFloat(e.spend.toFixed(2))?"less than 0.00":e.spend.toFixed(2)})]},e.provider))})]})})]})}):(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to use this feature"}),(0,a.jsx)(p.Z,{variant:"primary",className:"mb-2",children:(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})})]})]})})]})}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 h-[75vh] w-full",children:[(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"All Up"}),(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e6.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",eo(O.sum_api_requests)]}),(0,a.jsx)(ec.Z,{className:"h-40",data:O.daily_data,valueFormatter:eo,index:"date",colors:["cyan"],categories:["api_requests"],onValueChange:e=>console.log(e)})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e6.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",eo(O.sum_total_tokens)]}),(0,a.jsx)(em.Z,{className:"h-40",data:O.daily_data,valueFormatter:eo,index:"date",colors:["cyan"],categories:["total_tokens"],onValueChange:e=>console.log(e)})]})]})]}),o?(0,a.jsx)(a.Fragment,{children:M.map((e,l)=>(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:e.model}),(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e6.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",eo(e.sum_api_requests)]}),(0,a.jsx)(ec.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["api_requests"],valueFormatter:eo,onValueChange:e=>console.log(e)})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e6.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",eo(e.sum_total_tokens)]}),(0,a.jsx)(em.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["total_tokens"],valueFormatter:eo,onValueChange:e=>console.log(e)})]})]})]},l))}):(0,a.jsx)(a.Fragment,{children:M&&M.length>0&&M.slice(0,1).map((e,l)=>(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"✨ Activity by Model"}),(0,a.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to see analytics for all models"}),(0,a.jsx)(p.Z,{variant:"primary",className:"mb-2",children:(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:e.model}),(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e6.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",eo(e.sum_api_requests)]}),(0,a.jsx)(ec.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["api_requests"],valueFormatter:eo,onValueChange:e=>console.log(e)})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e6.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",eo(e.sum_total_tokens)]}),(0,a.jsx)(em.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],valueFormatter:eo,categories:["total_tokens"],onValueChange:e=>console.log(e)})]})]})]})]},l))})]})})]})]})}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(x.Z,{numItems:2,className:"gap-2 h-[75vh] w-full",children:[(0,a.jsxs)(h.Z,{numColSpan:2,children:[(0,a.jsxs)(F.Z,{className:"mb-2",children:[(0,a.jsx)(y.Z,{children:"Total Spend Per Team"}),(0,a.jsx)(e3.Z,{data:E})]}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Daily Spend Per Team"}),(0,a.jsx)(em.Z,{className:"h-72",data:S,showLegend:!0,index:"date",categories:A,yAxisWidth:80,colors:["blue","green","yellow","red","purple"],stack:!0})]})]}),(0,a.jsx)(h.Z,{numColSpan:2})]})}),(0,a.jsxs)(er.Z,{children:[(0,a.jsxs)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:["End-Users of your LLM API calls. Tracked when a `user` param is passed in your LLM calls ",(0,a.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/users",target:"_blank",children:"docs here"})]}),(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(_.Z,{children:"Select Time Range"}),(0,a.jsx)(es.Z,{enableSelect:!0,value:Y,onValueChange:e=>{$(e),ed(e.from,e.to,null)}})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(_.Z,{children:"Select Key"}),(0,a.jsxs)(z.Z,{defaultValue:"all-keys",children:[(0,a.jsx)(V.Z,{value:"all-keys",onClick:()=>{ed(Y.from,Y.to,null)},children:"All Keys"},"all-keys"),null==i?void 0:i.map((e,l)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,a.jsx)(V.Z,{value:String(l),onClick:()=>{ed(Y.from,Y.to,e.token)},children:e.key_alias},l):null)]})]})]}),(0,a.jsx)(F.Z,{className:"mt-4",children:(0,a.jsxs)(L.Z,{className:"max-h-[70vh] min-h-[500px]",children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"End User"}),(0,a.jsx)(B.Z,{children:"Spend"}),(0,a.jsx)(B.Z,{children:"Total Events"})]})}),(0,a.jsx)(U.Z,{children:null==b?void 0:b.map((e,l)=>{var s;return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.end_user}),(0,a.jsx)(D.Z,{children:null===(s=e.total_spend)||void 0===s?void 0:s.toFixed(4)}),(0,a.jsx)(D.Z,{children:e.total_count})]},l)})})]})})]}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(x.Z,{numItems:2,className:"gap-2 h-[75vh] w-full mb-4",children:[(0,a.jsxs)(h.Z,{numColSpan:2,children:[(0,a.jsx)(es.Z,{className:"mb-4",enableSelect:!0,value:Y,onValueChange:e=>{$(e),eu(e.from,e.to)}}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Spend Per Tag"}),(0,a.jsxs)(_.Z,{children:["Get Started Tracking cost per tag ",(0,a.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/enterprise#tracking-spend-for-custom-tags",target:"_blank",children:"here"})]}),(0,a.jsx)(em.Z,{className:"h-72",data:w,index:"name",categories:["spend"],colors:["blue"]})]})]}),(0,a.jsx)(h.Z,{numColSpan:2})]})})]})]})]})},le=()=>{let{Title:e,Paragraph:l}=ee.default,[s,t]=(0,r.useState)(""),[n,o]=(0,r.useState)(!1),[d,c]=(0,r.useState)(null),[u,h]=(0,r.useState)(null),[x,p]=(0,r.useState)(null),[j,g]=(0,r.useState)(!0),Z=(0,i.useSearchParams)(),[f,_]=(0,r.useState)({data:[]}),y=Z.get("userID"),b=Z.get("token"),[v,S]=(0,r.useState)("api-keys"),[k,w]=(0,r.useState)(null);return(0,r.useEffect)(()=>{if(b){let e=(0,Q.o)(b);if(e){if(console.log("Decoded token:",e),console.log("Decoded key:",e.key),w(e.key),e.user_role){let l=function(e){if(!e)return"Undefined Role";switch(console.log("Received user role: ".concat(e.toLowerCase())),console.log("Received user role length: ".concat(e.toLowerCase().length)),e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(e.user_role);console.log("Decoded user_role:",l),t(l),"Admin Viewer"==l&&S("usage")}else console.log("User role not defined");e.user_email?c(e.user_email):console.log("User Email is not set ".concat(e)),e.login_method?g("username_password"==e.login_method):console.log("User Email is not set ".concat(e)),e.premium_user&&o(e.premium_user)}}},[b]),(0,a.jsx)(r.Suspense,{fallback:(0,a.jsx)("div",{children:"Loading..."}),children:(0,a.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,a.jsx)(m,{userID:y,userRole:s,userEmail:d,showSSOBanner:j,premiumUser:n}),(0,a.jsxs)("div",{className:"flex flex-1 overflow-auto",children:[(0,a.jsx)("div",{className:"mt-8",children:(0,a.jsx)(e8,{setPage:S,userRole:s,defaultSelectedKey:null})}),"api-keys"==v?(0,a.jsx)(el,{userID:y,userRole:s,teams:u,keys:x,setUserRole:t,userEmail:d,setUserEmail:c,setTeams:h,setKeys:p}):"models"==v?(0,a.jsx)(eE,{userID:y,userRole:s,token:b,accessToken:k,modelData:f,setModelData:_,premiumUser:n}):"llm-playground"==v?(0,a.jsx)(e1,{userID:y,userRole:s,token:b,accessToken:k}):"users"==v?(0,a.jsx)(eO,{userID:y,userRole:s,token:b,keys:x,teams:u,accessToken:k,setKeys:p}):"teams"==v?(0,a.jsx)(eR,{teams:u,setTeams:h,searchParams:Z,accessToken:k,userID:y,userRole:s}):"admin-panel"==v?(0,a.jsx)(eF,{setTeams:h,searchParams:Z,accessToken:k,showSSOBanner:j}):"api_ref"==v?(0,a.jsx)(eQ,{}):"settings"==v?(0,a.jsx)(eB,{userID:y,userRole:s,accessToken:k,premiumUser:n}):"budgets"==v?(0,a.jsx)(e$,{accessToken:k}):"general-settings"==v?(0,a.jsx)(eY,{userID:y,userRole:s,accessToken:k,modelData:f}):"model-hub"==v?(0,a.jsx)(eX.Z,{accessToken:k,publicPage:!1,premiumUser:n}):(0,a.jsx)(e9,{userID:y,userRole:s,token:b,accessToken:k,keys:x,premiumUser:n})]})]})})}}},function(e){e.O(0,[936,359,440,134,971,69,744],function(){return e(e.s=20661)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/index.html b/litellm/proxy/_experimental/out/index.html index b12c05bc43..28d620ebfa 100644 --- a/litellm/proxy/_experimental/out/index.html +++ b/litellm/proxy/_experimental/out/index.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/index.txt b/litellm/proxy/_experimental/out/index.txt index 99372005b8..15941a1346 100644 --- a/litellm/proxy/_experimental/out/index.txt +++ b/litellm/proxy/_experimental/out/index.txt @@ -1,7 +1,7 @@ 2:I[77831,[],""] -3:I[62631,["936","static/chunks/2f6dbc85-052c4579f80d66ae.js","359","static/chunks/359-f105a7fb61fe8110.js","440","static/chunks/440-b9a05f116e1a696d.js","134","static/chunks/134-af41d2d267857018.js","931","static/chunks/app/page-0f6ae871c63eb14b.js"],""] +3:I[5347,["936","static/chunks/2f6dbc85-052c4579f80d66ae.js","359","static/chunks/359-f105a7fb61fe8110.js","440","static/chunks/440-b9a05f116e1a696d.js","134","static/chunks/134-af41d2d267857018.js","931","static/chunks/app/page-1fb033a77b428a50.js"],""] 4:I[5613,[],""] 5:I[31778,[],""] -0:["XsAEnZvT8GWmMEp4_0in-",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},["$L1",["$","$L2",null,{"propsForComponent":{"params":{}},"Component":"$3","isStaticGeneration":true}],null]]},[null,["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_c23dc8","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}]}],null]],[[["$","link","0",{"rel":"stylesheet","href":"/ui/_next/static/css/338efd41b0181c1e.css","precedence":"next","crossOrigin":""}]],"$L6"]]]] +0:["QpcxqKJjVnif9CYPhpWjb",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},["$L1",["$","$L2",null,{"propsForComponent":{"params":{}},"Component":"$3","isStaticGeneration":true}],null]]},[null,["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_c23dc8","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}]}],null]],[[["$","link","0",{"rel":"stylesheet","href":"/ui/_next/static/css/338efd41b0181c1e.css","precedence":"next","crossOrigin":""}]],"$L6"]]]] 6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/ui/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/model_hub/index.html b/litellm/proxy/_experimental/out/model_hub.html similarity index 98% rename from litellm/proxy/_experimental/out/model_hub/index.html rename to litellm/proxy/_experimental/out/model_hub.html index 02ef53bef0..75b1c508bb 100644 --- a/litellm/proxy/_experimental/out/model_hub/index.html +++ b/litellm/proxy/_experimental/out/model_hub.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/model_hub.txt b/litellm/proxy/_experimental/out/model_hub.txt index dd60dcaf67..3769dfc87e 100644 --- a/litellm/proxy/_experimental/out/model_hub.txt +++ b/litellm/proxy/_experimental/out/model_hub.txt @@ -2,6 +2,6 @@ 3:I[87494,["359","static/chunks/359-f105a7fb61fe8110.js","134","static/chunks/134-af41d2d267857018.js","418","static/chunks/app/model_hub/page-aa3c10cf9bb31255.js"],""] 4:I[5613,[],""] 5:I[31778,[],""] -0:["XsAEnZvT8GWmMEp4_0in-",[[["",{"children":["model_hub",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["model_hub",{"children":["__PAGE__",{},["$L1",["$","$L2",null,{"propsForComponent":{"params":{}},"Component":"$3","isStaticGeneration":true}],null]]},["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","model_hub","children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}]]},[null,["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_c23dc8","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}]}],null]],[[["$","link","0",{"rel":"stylesheet","href":"/ui/_next/static/css/338efd41b0181c1e.css","precedence":"next","crossOrigin":""}]],"$L6"]]]] +0:["QpcxqKJjVnif9CYPhpWjb",[[["",{"children":["model_hub",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["model_hub",{"children":["__PAGE__",{},["$L1",["$","$L2",null,{"propsForComponent":{"params":{}},"Component":"$3","isStaticGeneration":true}],null]]},["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","model_hub","children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}]]},[null,["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_c23dc8","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}]}],null]],[[["$","link","0",{"rel":"stylesheet","href":"/ui/_next/static/css/338efd41b0181c1e.css","precedence":"next","crossOrigin":""}]],"$L6"]]]] 6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/ui/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null diff --git a/ui/litellm-dashboard/out/404.html b/ui/litellm-dashboard/out/404.html index daae71ba32..2c4f52e83c 100644 --- a/ui/litellm-dashboard/out/404.html +++ b/ui/litellm-dashboard/out/404.html @@ -1 +1 @@ -404: This page could not be found.LiteLLM Dashboard

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.LiteLLM Dashboard

404

This page could not be found.

\ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/XsAEnZvT8GWmMEp4_0in-/_buildManifest.js b/ui/litellm-dashboard/out/_next/static/QpcxqKJjVnif9CYPhpWjb/_buildManifest.js similarity index 100% rename from ui/litellm-dashboard/out/_next/static/XsAEnZvT8GWmMEp4_0in-/_buildManifest.js rename to ui/litellm-dashboard/out/_next/static/QpcxqKJjVnif9CYPhpWjb/_buildManifest.js diff --git a/ui/litellm-dashboard/out/_next/static/XsAEnZvT8GWmMEp4_0in-/_ssgManifest.js b/ui/litellm-dashboard/out/_next/static/QpcxqKJjVnif9CYPhpWjb/_ssgManifest.js similarity index 100% rename from ui/litellm-dashboard/out/_next/static/XsAEnZvT8GWmMEp4_0in-/_ssgManifest.js rename to ui/litellm-dashboard/out/_next/static/QpcxqKJjVnif9CYPhpWjb/_ssgManifest.js diff --git a/ui/litellm-dashboard/out/_next/static/chunks/app/page-0f6ae871c63eb14b.js b/ui/litellm-dashboard/out/_next/static/chunks/app/page-0f6ae871c63eb14b.js deleted file mode 100644 index 5e1fb3b33d..0000000000 --- a/ui/litellm-dashboard/out/_next/static/chunks/app/page-0f6ae871c63eb14b.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{20661:function(e,l,s){Promise.resolve().then(s.bind(s,62631))},62631:function(e,l,s){"use strict";s.r(l),s.d(l,{default:function(){return e9}});var t,n,a=s(3827),r=s(64090),i=s(47907),o=s(8792),d=s(40491),c=s(65270),m=e=>{let{userID:l,userRole:s,userEmail:t,showSSOBanner:n,premiumUser:r}=e;console.log("User ID:",l),console.log("userEmail:",t),console.log("showSSOBanner:",n),console.log("premiumUser:",r);let i=[{key:"1",label:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("p",{children:["Role: ",s]}),(0,a.jsxs)("p",{children:["ID: ",l]}),(0,a.jsxs)("p",{children:["Premium User: ",String(r)]})]})}];return(0,a.jsxs)("nav",{className:"left-0 right-0 top-0 flex justify-between items-center h-12 mb-4",children:[(0,a.jsx)("div",{className:"text-left my-2 absolute top-0 left-0",children:(0,a.jsx)("div",{className:"flex flex-col items-center",children:(0,a.jsx)(o.default,{href:"/",children:(0,a.jsx)("button",{className:"text-gray-800 rounded text-center",children:(0,a.jsx)("img",{src:"/get_image",width:160,height:160,alt:"LiteLLM Brand",className:"mr-2"})})})})}),(0,a.jsxs)("div",{className:"text-right mx-4 my-2 absolute top-0 right-0 flex items-center justify-end space-x-2",children:[n?(0,a.jsx)("div",{style:{padding:"6px",borderRadius:"8px"},children:(0,a.jsx)("a",{href:"https://calendly.com/d/4mp-gd3-k5k/litellm-1-1-onboarding-chat",target:"_blank",style:{fontSize:"14px",textDecoration:"underline"},children:"Get enterpise license"})}):null,(0,a.jsx)("div",{style:{border:"1px solid #391085",padding:"6px",borderRadius:"8px"},children:(0,a.jsx)(d.Z,{menu:{items:i},children:(0,a.jsx)(c.Z,{children:t})})})]})]})},u=s(777),h=s(10384),x=s(46453),p=s(16450),j=s(52273),g=s(26780),Z=s(15595),f=s(6698),_=s(71801),y=s(42440),b=s(42308),v=s(50670),S=s(81583),k=s(80588),w=s(99129),N=s(44839),A=s(88707),I=s(1861);let{Option:C}=v.default;var E=e=>{let{userID:l,team:s,userRole:t,accessToken:n,data:i,setData:o}=e,[d]=S.Z.useForm(),[c,m]=(0,r.useState)(!1),[E,P]=(0,r.useState)(null),[T,O]=(0,r.useState)(null),[R,F]=(0,r.useState)([]),[M,L]=(0,r.useState)([]),U=()=>{m(!1),d.resetFields()},D=()=>{m(!1),P(null),d.resetFields()};(0,r.useEffect)(()=>{(async()=>{try{if(null===l||null===t)return;if(null!==n){let e=(await (0,u.So)(n,l,t)).data.map(e=>e.id);console.log("available_model_names:",e),F(e)}}catch(e){console.error("Error fetching user models:",e)}})()},[n,l,t]);let K=async e=>{try{var s,t,a;let r=null!==(s=null==e?void 0:e.key_alias)&&void 0!==s?s:"",c=null!==(t=null==e?void 0:e.team_id)&&void 0!==t?t:null;if((null!==(a=null==i?void 0:i.filter(e=>e.team_id===c).map(e=>e.key_alias))&&void 0!==a?a:[]).includes(r))throw Error("Key alias ".concat(r," already exists for team with ID ").concat(c,", please provide another key alias"));k.ZP.info("Making API Call"),m(!0);let h=await (0,u.wX)(n,l,e);console.log("key create Response:",h),o(e=>e?[...e,h]:[h]),P(h.key),O(h.soft_budget),k.ZP.success("API Key Created"),d.resetFields(),localStorage.removeItem("userData"+l)}catch(e){console.error("Error creating the key:",e),k.ZP.error("Error creating the key: ".concat(e),20)}};return(0,r.useEffect)(()=>{L(s&&s.models.length>0?s.models.includes("all-proxy-models")?R:s.models:R)},[s,R]),(0,a.jsxs)("div",{children:[(0,a.jsx)(p.Z,{className:"mx-auto",onClick:()=>m(!0),children:"+ Create New Key"}),(0,a.jsx)(w.Z,{title:"Create Key",visible:c,width:800,footer:null,onOk:U,onCancel:D,children:(0,a.jsxs)(S.Z,{form:d,onFinish:K,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Key Name",name:"key_alias",rules:[{required:!0,message:"Please input a key name"}],help:"required",children:(0,a.jsx)(j.Z,{placeholder:""})}),(0,a.jsx)(S.Z.Item,{label:"Team ID",name:"team_id",hidden:!0,initialValue:s?s.team_id:null,valuePropName:"team_id",className:"mt-8",children:(0,a.jsx)(N.Z,{value:s?s.team_alias:"",disabled:!0})}),(0,a.jsx)(S.Z.Item,{label:"Models",name:"models",rules:[{required:!0,message:"Please select a model"}],help:"required",children:(0,a.jsxs)(v.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},onChange:e=>{e.includes("all-team-models")&&d.setFieldsValue({models:["all-team-models"]})},children:[(0,a.jsx)(C,{value:"all-team-models",children:"All Team Models"},"all-team-models"),M.map(e=>(0,a.jsx)(C,{value:e,children:e},e))]})}),(0,a.jsxs)(g.Z,{className:"mt-20 mb-8",children:[(0,a.jsx)(f.Z,{children:(0,a.jsx)("b",{children:"Optional Settings"})}),(0,a.jsxs)(Z.Z,{children:[(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Max Budget (USD)",name:"max_budget",help:"Budget cannot exceed team max budget: $".concat((null==s?void 0:s.max_budget)!==null&&(null==s?void 0:s.max_budget)!==void 0?null==s?void 0:s.max_budget:"unlimited"),rules:[{validator:async(e,l)=>{if(l&&s&&null!==s.max_budget&&l>s.max_budget)throw Error("Budget cannot exceed team max budget: $".concat(s.max_budget))}}],children:(0,a.jsx)(A.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",help:"Team Reset Budget: ".concat((null==s?void 0:s.budget_duration)!==null&&(null==s?void 0:s.budget_duration)!==void 0?null==s?void 0:s.budget_duration:"None"),children:(0,a.jsxs)(v.default,{defaultValue:null,placeholder:"n/a",children:[(0,a.jsx)(v.default.Option,{value:"24h",children:"daily"}),(0,a.jsx)(v.default.Option,{value:"30d",children:"monthly"})]})}),(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Tokens per minute Limit (TPM)",name:"tpm_limit",help:"TPM cannot exceed team TPM limit: ".concat((null==s?void 0:s.tpm_limit)!==null&&(null==s?void 0:s.tpm_limit)!==void 0?null==s?void 0:s.tpm_limit:"unlimited"),rules:[{validator:async(e,l)=>{if(l&&s&&null!==s.tpm_limit&&l>s.tpm_limit)throw Error("TPM limit cannot exceed team TPM limit: ".concat(s.tpm_limit))}}],children:(0,a.jsx)(A.Z,{step:1,width:400})}),(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Requests per minute Limit (RPM)",name:"rpm_limit",help:"RPM cannot exceed team RPM limit: ".concat((null==s?void 0:s.rpm_limit)!==null&&(null==s?void 0:s.rpm_limit)!==void 0?null==s?void 0:s.rpm_limit:"unlimited"),rules:[{validator:async(e,l)=>{if(l&&s&&null!==s.rpm_limit&&l>s.rpm_limit)throw Error("RPM limit cannot exceed team RPM limit: ".concat(s.rpm_limit))}}],children:(0,a.jsx)(A.Z,{step:1,width:400})}),(0,a.jsx)(S.Z.Item,{label:"Expire Key (eg: 30s, 30h, 30d)",name:"duration",className:"mt-8",children:(0,a.jsx)(j.Z,{placeholder:""})}),(0,a.jsx)(S.Z.Item,{label:"Metadata",name:"metadata",className:"mt-8",children:(0,a.jsx)(N.Z.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})})]})]})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Create Key"})})]})}),E&&(0,a.jsx)(w.Z,{visible:c,onOk:U,onCancel:D,footer:null,children:(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 w-full",children:[(0,a.jsx)(y.Z,{children:"Save your Key"}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)("p",{children:["Please save this secret key somewhere safe and accessible. For security reasons, ",(0,a.jsx)("b",{children:"you will not be able to view it again"})," ","through your LiteLLM account. If you lose this secret key, you will need to generate a new one."]})}),(0,a.jsx)(h.Z,{numColSpan:1,children:null!=E?(0,a.jsxs)("div",{children:[(0,a.jsx)(_.Z,{className:"mt-3",children:"API Key:"}),(0,a.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,a.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:E})}),(0,a.jsx)(b.CopyToClipboard,{text:E,onCopy:()=>{k.ZP.success("API Key copied to clipboard")},children:(0,a.jsx)(p.Z,{className:"mt-3",children:"Copy API Key"})})]}):(0,a.jsx)(_.Z,{children:"Key being created, this might take 30s"})})]})})]})},P=s(9454),T=s(98941),O=s(33393),R=s(5),F=s(13810),M=s(61244),L=s(10827),U=s(3851),D=s(2044),K=s(64167),B=s(74480),q=s(7178),z=s(95093),V=s(27166);let{Option:G}=v.default;var W=e=>{let{userID:l,userRole:s,accessToken:t,selectedTeam:n,data:i,setData:o,teams:d}=e,[c,m]=(0,r.useState)(!1),[h,x]=(0,r.useState)(!1),[j,g]=(0,r.useState)(null),[Z,f]=(0,r.useState)(null),[b,C]=(0,r.useState)(null),[E,W]=(0,r.useState)(""),[H,Y]=(0,r.useState)(!1),[J,$]=(0,r.useState)(!1),[X,Q]=(0,r.useState)(null),[ee,el]=(0,r.useState)([]),es=new Set,[et,en]=(0,r.useState)(es);(0,r.useEffect)(()=>{(async()=>{try{if(null===l)return;if(null!==t&&null!==s){let e=(await (0,u.So)(t,l,s)).data.map(e=>e.id);console.log("available_model_names:",e),el(e)}}catch(e){console.error("Error fetching user models:",e)}})()},[t,l,s]),(0,r.useEffect)(()=>{if(d){let e=new Set;d.forEach((l,s)=>{let t=l.team_id;e.add(t)}),en(e)}},[d]);let ea=e=>{console.log("handleEditClick:",e),null==e.token&&null!==e.token_id&&(e.token=e.token_id),Q(e),Y(!0)},er=async e=>{if(null==t)return;let l=e.token;e.key=l,console.log("handleEditSubmit:",e);let s=await (0,u.Nc)(t,e);console.log("handleEditSubmit: newKeyValues",s),i&&o(i.map(e=>e.token===l?s:e)),k.ZP.success("Key updated successfully"),Y(!1),Q(null)},ei=async e=>{console.log("handleDelete:",e),null==e.token&&null!==e.token_id&&(e.token=e.token_id),null!=i&&(g(e.token),localStorage.removeItem("userData"+l),x(!0))},eo=async()=>{if(null!=j&&null!=i){try{await (0,u.I1)(t,j);let e=i.filter(e=>e.token!==j);o(e)}catch(e){console.error("Error deleting the key:",e)}x(!1),g(null)}};if(null!=i)return console.log("RERENDER TRIGGERED"),(0,a.jsxs)("div",{children:[(0,a.jsxs)(F.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh] mb-4 mt-2",children:[(0,a.jsxs)(L.Z,{className:"mt-5 max-h-[300px] min-h-[300px]",children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Key Alias"}),(0,a.jsx)(B.Z,{children:"Secret Key"}),(0,a.jsx)(B.Z,{children:"Spend (USD)"}),(0,a.jsx)(B.Z,{children:"Budget (USD)"}),(0,a.jsx)(B.Z,{children:"Models"}),(0,a.jsx)(B.Z,{children:"TPM / RPM Limits"})]})}),(0,a.jsx)(U.Z,{children:i.map(e=>{if(console.log(e),"litellm-dashboard"===e.team_id)return null;if(n){if(console.log("item team id: ".concat(e.team_id,", knownTeamIDs.has(item.team_id): ").concat(et.has(e.team_id),", selectedTeam id: ").concat(n.team_id)),(null!=n.team_id||null===e.team_id||et.has(e.team_id))&&e.team_id!=n.team_id)return null;console.log("item team id: ".concat(e.team_id,", is returned"))}return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{style:{maxWidth:"2px",whiteSpace:"pre-wrap",overflow:"hidden"},children:null!=e.key_alias?(0,a.jsx)(_.Z,{children:e.key_alias}):(0,a.jsx)(_.Z,{children:"Not Set"})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(_.Z,{children:e.key_name})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(_.Z,{children:(()=>{try{return parseFloat(e.spend).toFixed(4)}catch(l){return e.spend}})()})}),(0,a.jsx)(D.Z,{children:null!=e.max_budget?(0,a.jsx)(_.Z,{children:e.max_budget}):(0,a.jsx)(_.Z,{children:"Unlimited"})}),(0,a.jsx)(D.Z,{children:Array.isArray(e.models)?(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:0===e.models.length?(0,a.jsx)(a.Fragment,{children:n&&n.models&&n.models.length>0?n.models.map((e,l)=>"all-proxy-models"===e?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Proxy Models"})},l):"all-team-models"===e?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Team Models"})},l):(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,a.jsx)(_.Z,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},l)):(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,a.jsx)(_.Z,{children:"all-proxy-models"})})}):e.models.map((e,l)=>"all-proxy-models"===e?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Proxy Models"})},l):"all-team-models"===e?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Team Models"})},l):(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,a.jsx)(_.Z,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},l))}):null}),(0,a.jsx)(D.Z,{children:(0,a.jsxs)(_.Z,{children:["TPM: ",e.tpm_limit?e.tpm_limit:"Unlimited"," ",(0,a.jsx)("br",{})," RPM:"," ",e.rpm_limit?e.rpm_limit:"Unlimited"]})}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(M.Z,{onClick:()=>{Q(e),$(!0)},icon:P.Z,size:"sm"}),(0,a.jsx)(w.Z,{open:J,onCancel:()=>{$(!1),Q(null)},footer:null,width:800,children:X&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3 mt-8",children:[(0,a.jsxs)(F.Z,{children:[(0,a.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Spend"}),(0,a.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,a.jsx)("p",{className:"text-tremor font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:(()=>{try{return parseFloat(X.spend).toFixed(4)}catch(e){return X.spend}})()})})]}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Budget"}),(0,a.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,a.jsx)("p",{className:"text-tremor font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:null!=X.max_budget?(0,a.jsx)(a.Fragment,{children:X.max_budget}):(0,a.jsx)(a.Fragment,{children:"Unlimited"})})})]},e.name),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Expires"}),(0,a.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,a.jsx)("p",{className:"text-tremor-default font-small text-tremor-content-strong dark:text-dark-tremor-content-strong",children:null!=X.expires?(0,a.jsx)(a.Fragment,{children:new Date(X.expires).toLocaleString(void 0,{day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})}):(0,a.jsx)(a.Fragment,{children:"Never"})})})]},e.name)]}),(0,a.jsxs)(F.Z,{className:"my-4",children:[(0,a.jsx)(y.Z,{children:"Token Name"}),(0,a.jsx)(_.Z,{className:"my-1",children:X.key_alias?X.key_alias:X.key_name}),(0,a.jsx)(y.Z,{children:"Token ID"}),(0,a.jsx)(_.Z,{className:"my-1 text-[12px]",children:X.token}),(0,a.jsx)(y.Z,{children:"Metadata"}),(0,a.jsx)(_.Z,{className:"my-1",children:(0,a.jsxs)("pre",{children:[JSON.stringify(X.metadata)," "]})})]}),(0,a.jsx)(p.Z,{className:"mx-auto flex items-center",onClick:()=>{$(!1),Q(null)},children:"Close"})]})}),(0,a.jsx)(M.Z,{icon:T.Z,size:"sm",onClick:()=>ea(e)}),(0,a.jsx)(M.Z,{onClick:()=>ei(e),icon:O.Z,size:"sm"})]})]},e.token)})})]}),h&&(0,a.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,a.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,a.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,a.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,a.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,a.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,a.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,a.jsx)("div",{className:"sm:flex sm:items-start",children:(0,a.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,a.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Key"}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this key ?"})})]})})}),(0,a.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,a.jsx)(p.Z,{onClick:eo,color:"red",className:"ml-2",children:"Delete"}),(0,a.jsx)(p.Z,{onClick:()=>{x(!1),g(null)},children:"Cancel"})]})]})]})})]}),X&&(0,a.jsx)(e=>{let{visible:l,onCancel:s,token:t,onSubmit:i}=e,[o]=S.Z.useForm(),[c,m]=(0,r.useState)(n),[u,h]=(0,r.useState)([]),[x,p]=(0,r.useState)(!1);return(0,a.jsx)(w.Z,{title:"Edit Key",visible:l,width:800,footer:null,onOk:()=>{o.validateFields().then(e=>{o.resetFields()}).catch(e=>{console.error("Validation failed:",e)})},onCancel:s,children:(0,a.jsxs)(S.Z,{form:o,onFinish:er,initialValues:t,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Key Name",name:"key_alias",rules:[{required:!0,message:"Please input a key name"}],help:"required",children:(0,a.jsx)(N.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"Models",name:"models",rules:[{validator:(e,l)=>{let s=l.filter(e=>!c.models.includes(e)&&"all-team-models"!==e&&"all-proxy-models"!==e&&!c.models.includes("all-proxy-models"));return(console.log("errorModels: ".concat(s)),s.length>0)?Promise.reject("Some models are not part of the new team's models - ".concat(s,"Team models: ").concat(c.models)):Promise.resolve()}}],children:(0,a.jsxs)(v.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,a.jsx)(G,{value:"all-team-models",children:"All Team Models"},"all-team-models"),c&&c.models?c.models.includes("all-proxy-models")?ee.filter(e=>"all-proxy-models"!==e).map(e=>(0,a.jsx)(G,{value:e,children:e},e)):c.models.map(e=>(0,a.jsx)(G,{value:e,children:e},e)):ee.map(e=>(0,a.jsx)(G,{value:e,children:e},e))]})}),(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Max Budget (USD)",name:"max_budget",help:"Budget cannot exceed team max budget: ".concat((null==c?void 0:c.max_budget)!==null&&(null==c?void 0:c.max_budget)!==void 0?null==c?void 0:c.max_budget:"unlimited"),rules:[{validator:async(e,l)=>{if(l&&c&&null!==c.max_budget&&l>c.max_budget)throw console.log("keyTeam.max_budget: ".concat(c.max_budget)),Error("Budget cannot exceed team max budget: $".concat(c.max_budget))}}],children:(0,a.jsx)(A.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{label:"token",name:"token",hidden:!0}),(0,a.jsx)(S.Z.Item,{label:"Team",name:"team_id",help:"the team this key belongs to",children:(0,a.jsx)(z.Z,{value:t.team_alias,children:null==d?void 0:d.map((e,l)=>(0,a.jsx)(V.Z,{value:e.team_id,onClick:()=>m(e),children:e.team_alias},l))})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Edit Key"})})]})})},{visible:H,onCancel:()=>{Y(!1),Q(null)},token:X,onSubmit:er})]})},H=s(76032),Y=s(35152),J=e=>{let{userID:l,userRole:s,accessToken:t,userSpend:n,selectedTeam:i}=e;console.log("userSpend: ".concat(n));let[o,d]=(0,r.useState)(null!==n?n:0),[c,m]=(0,r.useState)(0),[h,x]=(0,r.useState)([]);(0,r.useEffect)(()=>{let e=async()=>{if(t&&l&&s&&"Admin"===s&&null==n)try{let e=await (0,u.Qy)(t);e&&(e.spend?d(e.spend):d(0),e.max_budget?m(e.max_budget):m(0))}catch(e){console.error("Error fetching global spend data:",e)}};(async()=>{try{if(null===l||null===s)return;if(null!==t){let e=(await (0,u.So)(t,l,s)).data.map(e=>e.id);console.log("available_model_names:",e),x(e)}}catch(e){console.error("Error fetching user models:",e)}})(),e()},[s,t,l]),(0,r.useEffect)(()=>{null!==n&&d(n)},[n]);let p=[];i&&i.models&&(p=i.models),p&&p.includes("all-proxy-models")?(console.log("user models:",h),p=h):p&&p.includes("all-team-models")?p=i.models:p&&0===p.length&&(p=h);let j=void 0!==o?o.toFixed(4):null;return console.log("spend in view user spend: ".concat(o)),(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("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:["$",j]})]}),(0,a.jsx)("div",{className:"ml-auto",children:(0,a.jsxs)(g.Z,{children:[(0,a.jsx)(f.Z,{children:(0,a.jsx)(_.Z,{children:"Team Models"})}),(0,a.jsx)(Z.Z,{className:"absolute right-0 z-10 bg-white p-2 shadow-lg max-w-xs",children:(0,a.jsx)(H.Z,{children:p.map(e=>(0,a.jsx)(Y.Z,{children:(0,a.jsx)(_.Z,{children:e})},e))})})]})})]})},$=e=>{let{userID:l,userRole:s,selectedTeam:t,accessToken:n}=e,[i,o]=(0,r.useState)([]);(0,r.useEffect)(()=>{(async()=>{try{if(null===l||null===s)return;if(null!==n){let e=(await (0,u.So)(n,l,s)).data.map(e=>e.id);console.log("available_model_names:",e),o(e)}}catch(e){console.error("Error fetching user models:",e)}})()},[n,l,s]);let d=[];return t&&t.models&&(d=t.models),d&&d.includes("all-proxy-models")&&(console.log("user models:",i),d=i),(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"mb-5",children:(0,a.jsx)("p",{className:"text-3xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:null==t?void 0:t.team_alias})})})},X=e=>{let l,{teams:s,setSelectedTeam:t,userRole:n}=e,i={models:[],team_id:null,team_alias:"Default Team"},[o,d]=(0,r.useState)(i);return(l="App User"===n?s:s?[...s,i]:[i],"App User"===n)?null:(0,a.jsxs)("div",{className:"mt-5 mb-5",children:[(0,a.jsx)(y.Z,{children:"Select Team"}),(0,a.jsx)(_.Z,{children:"If you belong to multiple teams, this setting controls which team is used by default when creating new API Keys."}),(0,a.jsxs)(_.Z,{className:"mt-3 mb-3",children:[(0,a.jsx)("b",{children:"Default Team:"})," If no team_id is set for a key, it will be grouped under here."]}),l&&l.length>0?(0,a.jsx)(z.Z,{defaultValue:"0",children:l.map((e,l)=>(0,a.jsx)(V.Z,{value:String(l),onClick:()=>t(e),children:e.team_alias},l))}):(0,a.jsxs)(_.Z,{children:["No team created. ",(0,a.jsx)("b",{children:"Defaulting to personal account."})]})]})},Q=s(37963),ee=s(97482);console.log("isLocal:",!1);var el=e=>{let{userID:l,userRole:s,teams:t,keys:n,setUserRole:o,userEmail:d,setUserEmail:c,setTeams:m,setKeys:p}=e,[j,g]=(0,r.useState)(null),Z=(0,i.useSearchParams)();Z.get("viewSpend"),(0,i.useRouter)();let f=Z.get("token"),[_,y]=(0,r.useState)(null),[b,v]=(0,r.useState)(null),[S,k]=(0,r.useState)([]),w={models:[],team_alias:"Default Team",team_id:null},[N,A]=(0,r.useState)(t?t[0]:w);if(window.addEventListener("beforeunload",function(){sessionStorage.clear()}),(0,r.useEffect)(()=>{if(f){let e=(0,Q.o)(f);if(e){if(console.log("Decoded token:",e),console.log("Decoded key:",e.key),y(e.key),e.user_role){let l=function(e){if(!e)return"Undefined Role";switch(console.log("Received user role: ".concat(e)),e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(e.user_role);console.log("Decoded user_role:",l),o(l)}else console.log("User role not defined");e.user_email?c(e.user_email):console.log("User Email is not set ".concat(e))}}if(l&&_&&s&&!n&&!j){let e=sessionStorage.getItem("userModels"+l);e?k(JSON.parse(e)):(async()=>{try{let e=await (0,u.Br)(_,l,s,!1,null,null);if(console.log("received teams in user dashboard: ".concat(Object.keys(e),"; team values: ").concat(Object.entries(e.teams))),"Admin"==s){let e=await (0,u.Qy)(_);g(e),console.log("globalSpend:",e)}else g(e.user_info);p(e.keys),m(e.teams);let t=[...e.teams];t.length>0?(console.log("response['teams']: ".concat(t)),A(t[0])):A(w),sessionStorage.setItem("userData"+l,JSON.stringify(e.keys)),sessionStorage.setItem("userSpendData"+l,JSON.stringify(e.user_info));let n=(await (0,u.So)(_,l,s)).data.map(e=>e.id);console.log("available_model_names:",n),k(n),console.log("userModels:",S),sessionStorage.setItem("userModels"+l,JSON.stringify(n))}catch(e){console.error("There was an error fetching the data",e)}})()}},[l,f,_,n,s]),(0,r.useEffect)(()=>{if(null!==n&&null!=N&&null!==N.team_id){let e=0;for(let l of n)N.hasOwnProperty("team_id")&&null!==l.team_id&&l.team_id===N.team_id&&(e+=l.spend);v(e)}else if(null!==n){let e=0;for(let l of n)e+=l.spend;v(e)}},[N]),null==l||null==f){let e="/sso/key/generate";return console.log("Full URL:",e),window.location.href=e,null}if(null==_)return null;if(null==s&&o("App Owner"),s&&"Admin Viewer"==s){let{Title:e,Paragraph:l}=ee.default;return(0,a.jsxs)("div",{children:[(0,a.jsx)(e,{level:1,children:"Access Denied"}),(0,a.jsx)(l,{children:"Ask your proxy admin for access to create keys"})]})}return console.log("inside user dashboard, selected team",N),(0,a.jsx)("div",{className:"w-full mx-4",children:(0,a.jsx)(x.Z,{numItems:1,className:"gap-2 p-8 h-[75vh] w-full mt-2",children:(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)($,{userID:l,userRole:s,selectedTeam:N||null,accessToken:_}),(0,a.jsx)(J,{userID:l,userRole:s,accessToken:_,userSpend:b,selectedTeam:N||null}),(0,a.jsx)(W,{userID:l,userRole:s,accessToken:_,selectedTeam:N||null,data:n,setData:p,teams:t}),(0,a.jsx)(E,{userID:l,team:N||null,userRole:s,accessToken:_,data:n,setData:p},N?N.team_id:null),(0,a.jsx)(X,{teams:t,setSelectedTeam:A,userRole:s})]})})})},es=s(35087),et=s(92836),en=s(26734),ea=s(41608),er=s(32126),ei=s(23682),eo=s(47047),ed=s(76628),ec=s(25707),em=s(44041),eu=s(1460),eh=s(28683),ex=s(38302),ep=s(78578),ej=s(63954),eg=e=>{let{modelID:l,accessToken:s}=e,[t,n]=(0,r.useState)(!1),i=async()=>{try{k.ZP.info("Making API Call"),n(!0);let e=await (0,u.Og)(s,l);console.log("model delete Response:",e),k.ZP.success("Model ".concat(l," deleted successfully")),n(!1)}catch(e){console.error("Error deleting the model:",e)}};return(0,a.jsxs)("div",{children:[(0,a.jsx)(M.Z,{onClick:()=>n(!0),icon:O.Z,size:"sm"}),(0,a.jsx)(w.Z,{open:t,onOk:i,okType:"danger",onCancel:()=>n(!1),children:(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 w-full",children:[(0,a.jsx)(y.Z,{children:"Delete Model"}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsx)("p",{children:"Are you sure you want to delete this model? This action is irreversible."})}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)("p",{children:["Model ID: ",(0,a.jsx)("b",{children:l})]})})]})})]})},eZ=s(97766),ef=s(46495),e_=s(18190),ey=s(91118),eb=e=>{let{modelMetrics:l,modelMetricsCategories:s,customTooltip:t,premiumUser:n}=e;return n?(0,a.jsx)(ey.Z,{title:"Time to First token (s)",className:"h-72",data:l,index:"date",showLegend:!1,categories:s,colors:["indigo","rose"],connectNulls:!0,customTooltip:t}):(0,a.jsxs)("div",{children:[(0,a.jsx)(e_.Z,{title:"✨ Enterprise Feature",color:"teal",className:"mt-2 mb-4",children:"Enterprise features are available for users with a specific license, please contact LiteLLM to unlock this limitation."}),(0,a.jsx)(p.Z,{variant:"primary",children:(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get in touch"})})]})},ev=e=>{let{fields:l,selectedProvider:s}=e;return 0===l.length?null:(0,a.jsx)(a.Fragment,{children:l.map(e=>(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:e.field_name.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),name:e.field_name,tooltip:e.field_description,className:"mb-2",children:(0,a.jsx)(j.Z,{placeholder:e.field_value,type:"password"})},e.field_name))})},eS=s(67951);let{Title:ek,Link:ew}=ee.default;(t=n||(n={})).OpenAI="OpenAI",t.Azure="Azure",t.Anthropic="Anthropic",t.Google_AI_Studio="Google AI Studio",t.Bedrock="Amazon Bedrock",t.OpenAI_Compatible="OpenAI-Compatible Endpoints (Groq, Together AI, Mistral AI, etc.)",t.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",t.Databricks="Databricks";let eN={OpenAI:"openai",Azure:"azure",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",OpenAI_Compatible:"openai",Vertex_AI:"vertex_ai",Databricks:"databricks"},eA={"BadRequestError (400)":"BadRequestErrorRetries","AuthenticationError (401)":"AuthenticationErrorRetries","TimeoutError (408)":"TimeoutErrorRetries","RateLimitError (429)":"RateLimitErrorRetries","ContentPolicyViolationError (400)":"ContentPolicyViolationErrorRetries","InternalServerError (500)":"InternalServerErrorRetries"},eI=async(e,l,s)=>{try{let t=Array.isArray(e.model)?e.model:[e.model];console.log("received deployments: ".concat(t)),console.log("received type of deployments: ".concat(typeof t)),t.forEach(async s=>{console.log("litellm_model: ".concat(s));let t={},n={};t.model=s;let a="";for(let[l,s]of(console.log("formValues add deployment:",e),Object.entries(e)))if(""!==s){if("model_name"==l)a+=s;else if("custom_llm_provider"==l)continue;else if("model"==l)continue;else if("base_model"===l)n[l]=s;else if("litellm_extra_params"==l){console.log("litellm_extra_params:",s);let e={};if(s&&void 0!=s){try{e=JSON.parse(s)}catch(e){throw k.ZP.error("Failed to parse LiteLLM Extra Params: "+e,10),Error("Failed to parse litellm_extra_params: "+e)}for(let[l,s]of Object.entries(e))t[l]=s}}else t[l]=s}let r={model_name:a,litellm_params:t,model_info:n},i=await (0,u.kK)(l,r);console.log("response for model create call: ".concat(i.data))}),s.resetFields()}catch(e){k.ZP.error("Failed to create model: "+e,10)}};var eC=e=>{var l,s,t;let i,{accessToken:o,token:d,userRole:c,userID:m,modelData:h={data:[]},setModelData:g,premiumUser:Z}=e,[f,b]=(0,r.useState)([]),[v]=S.Z.useForm(),[N,C]=(0,r.useState)(null),[E,O]=(0,r.useState)(""),[G,W]=(0,r.useState)([]),H=Object.values(n).filter(e=>isNaN(Number(e))),[Y,J]=(0,r.useState)([]),[$,X]=(0,r.useState)("OpenAI"),[Q,el]=(0,r.useState)(""),[e_,ey]=(0,r.useState)(!1),[eC,eE]=(0,r.useState)(!1),[eP,eT]=(0,r.useState)(null),[eO,eR]=(0,r.useState)([]),[eF,eM]=(0,r.useState)(null),[eL,eU]=(0,r.useState)([]),[eD,eK]=(0,r.useState)([]),[eB,eq]=(0,r.useState)([]),[ez,eV]=(0,r.useState)([]),[eG,eW]=(0,r.useState)([]),[eH,eY]=(0,r.useState)([]),[eJ,e$]=(0,r.useState)([]),[eX,eQ]=(0,r.useState)([]),[e0,e1]=(0,r.useState)([]),[e2,e4]=(0,r.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[e5,e8]=(0,r.useState)(null),[e3,e6]=(0,r.useState)(0),e7=e=>{eT(e),ey(!0)},e9=e=>{eT(e),eE(!0)},le=async e=>{if(console.log("handleEditSubmit:",e),null==o)return;let l={},s=null;for(let[t,n]of Object.entries(e))"model_id"!==t?l[t]=n:s=n;let t={litellm_params:l,model_info:{id:s}};console.log("handleEditSubmit payload:",t);try{await (0,u.um)(o,t),k.ZP.success("Model updated successfully, restart server to see updates"),ey(!1),eT(null)}catch(e){console.log("Error occurred")}},ll=()=>{O(new Date().toLocaleString())},ls=async()=>{if(!o){console.error("Access token is missing");return}console.log("new modelGroupRetryPolicy:",e5);try{await (0,u.K_)(o,{router_settings:{model_group_retry_policy:e5}}),k.ZP.success("Retry settings saved successfully")}catch(e){console.error("Failed to save retry settings:",e),k.ZP.error("Failed to save retry settings")}};if((0,r.useEffect)(()=>{if(!o||!d||!c||!m)return;let e=async()=>{try{var e,l,s,t,n,a,r,i;let d=await (0,u.hy)(o);J(d);let h=await (0,u.AZ)(o,m,c);console.log("Model data response:",h.data),g(h);let x=new Set;for(let e=0;e0&&(j=p[p.length-1],console.log("_initial_model_group:",j),eM(j)),console.log("selectedModelGroup:",eF);let Z=await (0,u.o6)(o,m,c,j,null===(e=e2.from)||void 0===e?void 0:e.toISOString(),null===(l=e2.to)||void 0===l?void 0:l.toISOString());console.log("Model metrics response:",Z),eK(Z.data),eq(Z.all_api_bases);let f=await (0,u.Rg)(o,j,null===(s=e2.from)||void 0===s?void 0:s.toISOString(),null===(t=e2.to)||void 0===t?void 0:t.toISOString());eV(f.data),eW(f.all_api_bases);let _=await (0,u.N8)(o,m,c,j,null===(n=e2.from)||void 0===n?void 0:n.toISOString(),null===(a=e2.to)||void 0===a?void 0:a.toISOString());console.log("Model exceptions response:",_),eY(_.data),e$(_.exception_types);let y=await (0,u.fP)(o,m,c,j,null===(r=e2.from)||void 0===r?void 0:r.toISOString(),null===(i=e2.to)||void 0===i?void 0:i.toISOString());console.log("slowResponses:",y),e1(y);let b=(await (0,u.BL)(o,m,c)).router_settings;console.log("routerSettingsInfo:",b);let v=b.model_group_retry_policy,S=b.num_retries;console.log("model_group_retry_policy:",v),console.log("default_retries:",S),e8(v),e6(S)}catch(e){console.error("There was an error fetching the model data",e)}};o&&d&&c&&m&&e();let l=async()=>{let e=await (0,u.qm)();console.log("received model cost map data: ".concat(Object.keys(e))),C(e)};null==N&&l(),ll()},[o,d,c,m,N,E]),!h||!o||!d||!c||!m)return(0,a.jsx)("div",{children:"Loading..."});let lt=[];for(let e=0;e(console.log("GET PROVIDER CALLED! - ".concat(N)),null!=N&&"object"==typeof N&&e in N)?N[e].litellm_provider:"openai";if(n){let e=n.split("/"),l=e[0];r=1===e.length?u(n):l}else r="openai";a&&(i=null==a?void 0:a.input_cost_per_token,o=null==a?void 0:a.output_cost_per_token,d=null==a?void 0:a.max_tokens,c=null==a?void 0:a.max_input_tokens),(null==t?void 0:t.litellm_params)&&(m=Object.fromEntries(Object.entries(null==t?void 0:t.litellm_params).filter(e=>{let[l]=e;return"model"!==l&&"api_base"!==l}))),h.data[e].provider=r,h.data[e].input_cost=i,h.data[e].output_cost=o,h.data[e].input_cost&&(h.data[e].input_cost=(1e6*Number(h.data[e].input_cost)).toFixed(2)),h.data[e].output_cost&&(h.data[e].output_cost=(1e6*Number(h.data[e].output_cost)).toFixed(2)),h.data[e].max_tokens=d,h.data[e].max_input_tokens=c,h.data[e].api_base=null==t?void 0:null===(s=t.litellm_params)||void 0===s?void 0:s.api_base,h.data[e].cleanedLitellmParams=m,lt.push(t.model_name),console.log(h.data[e])}if(c&&"Admin Viewer"==c){let{Title:e,Paragraph:l}=ee.default;return(0,a.jsxs)("div",{children:[(0,a.jsx)(e,{level:1,children:"Access Denied"}),(0,a.jsx)(l,{children:"Ask your proxy admin for access to view all models"})]})}let ln=e=>{console.log("received provider string: ".concat(e));let l=Object.keys(n).find(l=>n[l]===e);if(l){let e=eN[l];console.log("mappingResult: ".concat(e));let s=[];"object"==typeof N&&Object.entries(N).forEach(l=>{let[t,n]=l;null!==n&&"object"==typeof n&&"litellm_provider"in n&&(n.litellm_provider===e||n.litellm_provider.includes(e))&&s.push(t)}),W(s),console.log("providerModels: ".concat(G))}},la=async()=>{try{k.ZP.info("Running health check..."),el("");let e=await (0,u.EY)(o);el(e)}catch(e){console.error("Error running health check:",e),el("Error running health check")}},lr=async(e,l,s)=>{if(console.log("Updating model metrics for group:",e),o&&m&&c&&l&&s){console.log("inside updateModelMetrics - startTime:",l,"endTime:",s),eM(e);try{let t=await (0,u.o6)(o,m,c,e,l.toISOString(),s.toISOString());console.log("Model metrics response:",t),eK(t.data),eq(t.all_api_bases);let n=await (0,u.Rg)(o,e,l.toISOString(),s.toISOString());eV(n.data),eW(n.all_api_bases);let a=await (0,u.N8)(o,m,c,e,l.toISOString(),s.toISOString());console.log("Model exceptions response:",a),eY(a.data),e$(a.exception_types);let r=await (0,u.fP)(o,m,c,e,l.toISOString(),s.toISOString());console.log("slowResponses:",r),e1(r)}catch(e){console.error("Failed to fetch model metrics",e)}}},li=e=>{var l,s;let{payload:t,active:n}=e;if(!n||!t)return null;let r=null===(s=t[0])||void 0===s?void 0:null===(l=s.payload)||void 0===l?void 0:l.date,i=t.sort((e,l)=>l.value-e.value);if(i.length>5){let e=i.length-5;(i=i.slice(0,5)).push({dataKey:"".concat(e," other deployments"),value:t.slice(5).reduce((e,l)=>e+l.value,0),color:"gray"})}return(0,a.jsxs)("div",{className:"w-150 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown",children:[r&&(0,a.jsxs)("p",{className:"text-tremor-content-emphasis mb-2",children:["Date: ",r]}),i.map((e,l)=>{let s=parseFloat(e.value.toFixed(5)),t=0===s&&e.value>0?"<0.00001":s.toFixed(5);return(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("div",{className:"w-2 h-2 mt-1 rounded-full bg-".concat(e.color,"-500")}),(0,a.jsx)("p",{className:"text-tremor-content",children:e.dataKey})]}),(0,a.jsx)("p",{className:"font-medium text-tremor-content-emphasis text-righ ml-2",children:t})]},l)})]})};console.log("selectedProvider: ".concat($)),console.log("providerModels.length: ".concat(G.length));let lo=Object.keys(n).find(e=>n[e]===$);return lo&&(i=Y.find(e=>e.name===eN[lo])),(0,a.jsx)("div",{style:{width:"100%",height:"100%"},children:(0,a.jsxs)(en.Z,{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,a.jsxs)(ea.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)(et.Z,{children:"All Models"}),(0,a.jsx)(et.Z,{children:"Add Model"}),(0,a.jsx)(et.Z,{children:(0,a.jsx)("pre",{children:"/health Models"})}),(0,a.jsx)(et.Z,{children:"Model Analytics"}),(0,a.jsx)(et.Z,{children:"Model Retry Settings"})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[E&&(0,a.jsxs)(_.Z,{children:["Last Refreshed: ",E]}),(0,a.jsx)(M.Z,{icon:ej.Z,variant:"shadow",size:"xs",className:"self-center",onClick:ll})]})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsxs)(er.Z,{children:[(0,a.jsxs)(x.Z,{children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(_.Z,{children:"Filter by Public Model Name"}),(0,a.jsxs)(z.Z,{className:"mb-4 mt-2 ml-2 w-50",defaultValue:eF||eO[0],onValueChange:e=>eM("all"===e?"all":e),value:eF||eO[0],children:[(0,a.jsx)(V.Z,{value:"all",children:"All Models"}),eO.map((e,l)=>(0,a.jsx)(V.Z,{value:e,onClick:()=>eM(e),children:e},l))]})]}),(0,a.jsx)(F.Z,{children:(0,a.jsxs)(L.Z,{style:{maxWidth:"1500px",width:"100%"},children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{style:{maxWidth:"150px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:"Public Model Name"}),(0,a.jsx)(B.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:"Provider"}),"Admin"===c&&(0,a.jsx)(B.Z,{style:{maxWidth:"150px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:"API Base"}),(0,a.jsxs)(B.Z,{style:{maxWidth:"85px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:["Input Price"," ",(0,a.jsx)("p",{style:{fontSize:"10px",color:"gray"},children:"/1M Tokens ($)"})]}),(0,a.jsxs)(B.Z,{style:{maxWidth:"85px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:["Output Price"," ",(0,a.jsx)("p",{style:{fontSize:"10px",color:"gray"},children:"/1M Tokens ($)"})]}),(0,a.jsx)(B.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:Z?"Created At":(0,a.jsxs)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",style:{color:"#72bcd4"},children:[" ","✨ Created At"]})}),(0,a.jsx)(B.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:Z?"Created By":(0,a.jsxs)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",style:{color:"#72bcd4"},children:[" ","✨ Created By"]})}),(0,a.jsx)(B.Z,{style:{maxWidth:"50px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:"Status"}),(0,a.jsx)(B.Z,{})]})}),(0,a.jsx)(U.Z,{children:h.data.filter(e=>"all"===eF||e.model_name===eF||null==eF||""===eF).map((e,l)=>{var s;return(0,a.jsxs)(q.Z,{style:{maxHeight:"1px",minHeight:"1px"},children:[(0,a.jsx)(D.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:e.model_name||"-"})}),(0,a.jsx)(D.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:e.provider||"-"})}),"Admin"===c&&(0,a.jsx)(D.Z,{style:{maxWidth:"150px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsx)(eu.Z,{title:e&&e.api_base,children:(0,a.jsx)("pre",{style:{maxWidth:"150px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"10px"},title:e&&e.api_base?e.api_base:"",children:e&&e.api_base?e.api_base.slice(0,20):"-"})})}),(0,a.jsx)(D.Z,{style:{maxWidth:"80px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsx)("pre",{style:{fontSize:"10px"},children:e.input_cost?e.input_cost:e.litellm_params.input_cost_per_token?(1e6*Number(e.litellm_params.input_cost_per_token)).toFixed(2):null})}),(0,a.jsx)(D.Z,{style:{maxWidth:"80px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsx)("pre",{style:{fontSize:"10px"},children:e.output_cost?e.output_cost:e.litellm_params.output_cost_per_token?(1e6*Number(e.litellm_params.output_cost_per_token)).toFixed(2):null})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:Z&&((s=e.model_info.created_at)?new Date(s).toLocaleDateString("en-US"):null)||"-"})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:Z&&e.model_info.created_by||"-"})}),(0,a.jsx)(D.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word"},children:e.model_info.db_model?(0,a.jsx)(R.Z,{size:"xs",className:"text-white",children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:"DB Model"})}):(0,a.jsx)(R.Z,{size:"xs",className:"text-black",children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:"Config Model"})})}),(0,a.jsx)(D.Z,{style:{maxWidth:"150px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsxs)(x.Z,{numItems:3,children:[(0,a.jsx)(eh.Z,{children:(0,a.jsx)(M.Z,{icon:P.Z,size:"sm",onClick:()=>e9(e)})}),(0,a.jsx)(eh.Z,{children:(0,a.jsx)(M.Z,{icon:T.Z,size:"sm",onClick:()=>e7(e)})}),(0,a.jsx)(eh.Z,{children:(0,a.jsx)(eg,{modelID:e.model_info.id,accessToken:o})})]})})]},l)})})]})})]}),(0,a.jsx)(e=>{let{visible:l,onCancel:s,model:t,onSubmit:n}=e,[r]=S.Z.useForm(),i={},o="",d="";if(t){i=t.litellm_params,o=t.model_name;let e=t.model_info;e&&(d=e.id,console.log("model_id: ".concat(d)),i.model_id=d)}return(0,a.jsx)(w.Z,{title:"Edit Model "+o,visible:l,width:800,footer:null,onOk:()=>{r.validateFields().then(e=>{n(e),r.resetFields()}).catch(e=>{console.error("Validation failed:",e)})},onCancel:s,children:(0,a.jsxs)(S.Z,{form:r,onFinish:le,initialValues:i,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"api_base",name:"api_base",children:(0,a.jsx)(j.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"tpm",name:"tpm",tooltip:"int (optional) - Tokens limit for this deployment: in tokens per minute (tpm). Find this information on your model/providers website",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"rpm",name:"rpm",tooltip:"int (optional) - Rate limit for this deployment: in requests per minute (rpm). Find this information on your model/providers website",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"max_retries",name:"max_retries",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"timeout",name:"timeout",tooltip:"int (optional) - Timeout in seconds for LLM requests (Defaults to 600 seconds)",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"stream_timeout",name:"stream_timeout",tooltip:"int (optional) - Timeout for stream requests (seconds)",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"input_cost_per_token",name:"input_cost_per_token",tooltip:"float (optional) - Input cost per token",children:(0,a.jsx)(A.Z,{min:0,step:1e-4})}),(0,a.jsx)(S.Z.Item,{label:"output_cost_per_token",name:"output_cost_per_token",tooltip:"float (optional) - Output cost per token",children:(0,a.jsx)(A.Z,{min:0,step:1e-4})}),(0,a.jsx)(S.Z.Item,{label:"model_id",name:"model_id",hidden:!0})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Save"})})]})})},{visible:e_,onCancel:()=>{ey(!1),eT(null)},model:eP,onSubmit:le}),(0,a.jsxs)(w.Z,{title:eP&&eP.model_name,visible:eC,width:800,footer:null,onCancel:()=>{eE(!1),eT(null)},children:[(0,a.jsx)(y.Z,{children:"Model Info"}),(0,a.jsx)(eS.Z,{language:"json",children:eP&&JSON.stringify(eP,null,2)})]})]}),(0,a.jsxs)(er.Z,{className:"h-full",children:[(0,a.jsx)(ek,{level:2,children:"Add new model"}),(0,a.jsx)(F.Z,{children:(0,a.jsxs)(S.Z,{form:v,onFinish:()=>{v.validateFields().then(e=>{eI(e,o,v)}).catch(e=>{console.error("Validation failed:",e)})},labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.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,a.jsx)(z.Z,{value:$.toString(),children:H.map((e,l)=>(0,a.jsx)(V.Z,{value:e,onClick:()=>{ln(e),X(e)},children:e},l))})}),(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Public Model Name",name:"model_name",tooltip:"Model name your users will pass in. Also used for load-balancing, LiteLLM will load balance between all models with this public name.",className:"mb-0",children:(0,a.jsx)(j.Z,{placeholder:"Vertex AI (Anthropic, Gemini, etc.)"===(t=$.toString())?"gemini-pro":"Anthropic"==t?"claude-3-opus":"Amazon Bedrock"==t?"claude-3-opus":"Google AI Studio"==t?"gemini-pro":"gpt-3.5-turbo"})}),(0,a.jsxs)(ex.Z,{children:[(0,a.jsx)(eh.Z,{span:10}),(0,a.jsx)(eh.Z,{span:10,children:(0,a.jsx)(_.Z,{className:"mb-3 mt-1",children:"Model name your users will pass in."})})]}),(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"LiteLLM Model Name(s)",name:"model",tooltip:"Actual model name used for making litellm.completion() call.",className:"mb-0",children:"Azure"===$?(0,a.jsx)(j.Z,{placeholder:"Enter model name"}):G.length>0?(0,a.jsx)(eo.Z,{value:G,children:G.map((e,l)=>(0,a.jsx)(ed.Z,{value:e,children:e},l))}):(0,a.jsx)(j.Z,{placeholder:"gpt-3.5-turbo-0125"})}),(0,a.jsxs)(ex.Z,{children:[(0,a.jsx)(eh.Z,{span:10}),(0,a.jsx)(eh.Z,{span:10,children:(0,a.jsxs)(_.Z,{className:"mb-3 mt-1",children:["Actual model name used for making"," ",(0,a.jsx)(ew,{href:"https://docs.litellm.ai/docs/providers",target:"_blank",children:"litellm.completion() call"}),". We'll"," ",(0,a.jsx)(ew,{href:"https://docs.litellm.ai/docs/proxy/reliability#step-1---set-deployments-on-config",target:"_blank",children:"loadbalance"})," ","models with the same 'public name'"]})})]}),void 0!==i&&i.fields.length>0&&(0,a.jsx)(ev,{fields:i.fields,selectedProvider:i.name}),"Amazon Bedrock"!=$&&"Vertex AI (Anthropic, Gemini, etc.)"!=$&&void 0===i&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"API Key",name:"api_key",children:(0,a.jsx)(j.Z,{placeholder:"sk-",type:"password"})}),"OpenAI"==$&&(0,a.jsx)(S.Z.Item,{label:"Organization ID",name:"organization_id",children:(0,a.jsx)(j.Z,{placeholder:"[OPTIONAL] my-unique-org"})}),"Vertex AI (Anthropic, Gemini, etc.)"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Vertex Project",name:"vertex_project",children:(0,a.jsx)(j.Z,{placeholder:"adroit-cadet-1234.."})}),"Vertex AI (Anthropic, Gemini, etc.)"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Vertex Location",name:"vertex_location",children:(0,a.jsx)(j.Z,{placeholder:"us-east-1"})}),"Vertex AI (Anthropic, Gemini, etc.)"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Vertex Credentials",name:"vertex_credentials",className:"mb-0",children:(0,a.jsx)(ef.Z,{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;v.setFieldsValue({vertex_credentials:l})}},l.readAsText(e)}return!1},onChange(e){"uploading"!==e.file.status&&console.log(e.file,e.fileList),"done"===e.file.status?k.ZP.success("".concat(e.file.name," file uploaded successfully")):"error"===e.file.status&&k.ZP.error("".concat(e.file.name," file upload failed."))},children:(0,a.jsx)(I.ZP,{icon:(0,a.jsx)(eZ.Z,{}),children:"Click to Upload"})})}),"Vertex AI (Anthropic, Gemini, etc.)"==$&&(0,a.jsxs)(ex.Z,{children:[(0,a.jsx)(eh.Z,{span:10}),(0,a.jsx)(eh.Z,{span:10,children:(0,a.jsx)(_.Z,{className:"mb-3 mt-1",children:"Give litellm a gcp service account(.json file), so it can make the relevant calls"})})]}),("Azure"==$||"OpenAI-Compatible Endpoints (Groq, Together AI, Mistral AI, etc.)"==$)&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"API Base",name:"api_base",children:(0,a.jsx)(j.Z,{placeholder:"https://..."})}),"Azure"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"API Version",name:"api_version",children:(0,a.jsx)(j.Z,{placeholder:"2023-07-01-preview"})}),"Azure"==$&&(0,a.jsxs)("div",{children:[(0,a.jsx)(S.Z.Item,{label:"Base Model",name:"base_model",className:"mb-0",children:(0,a.jsx)(j.Z,{placeholder:"azure/gpt-3.5-turbo"})}),(0,a.jsxs)(ex.Z,{children:[(0,a.jsx)(eh.Z,{span:10}),(0,a.jsx)(eh.Z,{span:10,children:(0,a.jsxs)(_.Z,{className:"mb-2",children:["The actual model your azure deployment uses. Used for accurate cost tracking. Select name from"," ",(0,a.jsx)(ew,{href:"https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json",target:"_blank",children:"here"})]})})]})]}),"Amazon Bedrock"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"AWS Access Key ID",name:"aws_access_key_id",tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`).",children:(0,a.jsx)(j.Z,{placeholder:""})}),"Amazon Bedrock"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"AWS Secret Access Key",name:"aws_secret_access_key",tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`).",children:(0,a.jsx)(j.Z,{placeholder:""})}),"Amazon Bedrock"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"AWS Region Name",name:"aws_region_name",tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`).",children:(0,a.jsx)(j.Z,{placeholder:"us-east-1"})}),(0,a.jsx)(S.Z.Item,{label:"LiteLLM Params",name:"litellm_extra_params",tooltip:"Optional litellm params used for making a litellm.completion() call.",className:"mb-0",children:(0,a.jsx)(ep.Z,{rows:4,placeholder:'{ "rpm": 100, "timeout": 0, "stream_timeout": 0 }'})}),(0,a.jsxs)(ex.Z,{children:[(0,a.jsx)(eh.Z,{span:10}),(0,a.jsx)(eh.Z,{span:10,children:(0,a.jsxs)(_.Z,{className:"mb-3 mt-1",children:["Pass JSON of litellm supported params"," ",(0,a.jsx)(ew,{href:"https://docs.litellm.ai/docs/completion/input",target:"_blank",children:"litellm.completion() call"})]})})]})]}),(0,a.jsx)("div",{style:{textAlign:"center",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Add Model"})}),(0,a.jsx)(eu.Z,{title:"Get help on our github",children:(0,a.jsx)(ee.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})})]})})]}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(_.Z,{children:"`/health` will run a very small request through your models configured on litellm"}),(0,a.jsx)(p.Z,{onClick:la,children:"Run `/health`"}),Q&&(0,a.jsx)("pre",{children:JSON.stringify(Q,null,2)})]})}),(0,a.jsxs)(er.Z,{children:[(0,a.jsxs)(x.Z,{numItems:2,className:"mt-2",children:[(0,a.jsxs)(eh.Z,{children:[(0,a.jsx)(_.Z,{children:"Select Time Range"}),(0,a.jsx)(es.Z,{enableSelect:!0,value:e2,onValueChange:e=>{e4(e),lr(eF,e.from,e.to)}})]}),(0,a.jsxs)(eh.Z,{children:[(0,a.jsx)(_.Z,{children:"Select Model Group"}),(0,a.jsx)(z.Z,{className:"mb-4 mt-2",defaultValue:eF||eO[0],value:eF||eO[0],children:eO.map((e,l)=>(0,a.jsx)(V.Z,{value:e,onClick:()=>lr(e,e2.from,e2.to),children:e},l))})]})]}),(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsx)(eh.Z,{children:(0,a.jsx)(F.Z,{className:"mr-2 max-h-[400px] min-h-[400px]",children:(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{variant:"line",defaultValue:"1",children:[(0,a.jsx)(et.Z,{value:"1",children:"Avg. Latency per Token"}),(0,a.jsx)(et.Z,{value:"2",children:"✨ Time to first token"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsxs)(er.Z,{children:[(0,a.jsx)("p",{className:"text-gray-500 italic",children:" (seconds/token)"}),(0,a.jsx)(_.Z,{className:"text-gray-500 italic mt-1 mb-1",children:"average Latency for successfull requests divided by the total tokens"}),eD&&eB&&(0,a.jsx)(ec.Z,{title:"Model Latency",className:"h-72",data:eD,showLegend:!1,index:"date",categories:eB,connectNulls:!0,customTooltip:li})]}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eb,{modelMetrics:ez,modelMetricsCategories:eG,customTooltip:li,premiumUser:Z})})]})]})})}),(0,a.jsx)(eh.Z,{children:(0,a.jsx)(F.Z,{className:"ml-2 max-h-[400px] min-h-[400px] overflow-y-auto",children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Deployment"}),(0,a.jsx)(B.Z,{children:"Success Responses"}),(0,a.jsxs)(B.Z,{children:["Slow Responses ",(0,a.jsx)("p",{children:"Success Responses taking 600+s"})]})]})}),(0,a.jsx)(U.Z,{children:e0.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.api_base}),(0,a.jsx)(D.Z,{children:e.total_count}),(0,a.jsx)(D.Z,{children:e.slow_count})]},l))})]})})})]}),(0,a.jsxs)(F.Z,{className:"mt-4",children:[(0,a.jsx)(y.Z,{children:"Exceptions per Model"}),(0,a.jsx)(em.Z,{className:"h-72",data:eH,index:"model",categories:eJ,stack:!0,colors:["indigo-300","rose-200","#ffcc33"],yAxisWidth:30})]})]}),(0,a.jsxs)(er.Z,{children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(_.Z,{children:"Filter by Public Model Name"}),(0,a.jsx)(z.Z,{className:"mb-4 mt-2 ml-2 w-50",defaultValue:eF||eO[0],value:eF||eO[0],onValueChange:e=>eM(e),children:eO.map((e,l)=>(0,a.jsx)(V.Z,{value:e,onClick:()=>eM(e),children:e},l))})]}),(0,a.jsxs)(y.Z,{children:["Retry Policy for ",eF]}),(0,a.jsx)(_.Z,{className:"mb-6",children:"How many retries should be attempted based on the Exception"}),eA&&(0,a.jsx)("table",{children:(0,a.jsx)("tbody",{children:Object.entries(eA).map((e,l)=>{var s;let[t,n]=e,r=null==e5?void 0:null===(s=e5[eF])||void 0===s?void 0:s[n];return null==r&&(r=e3),(0,a.jsxs)("tr",{className:"flex justify-between items-center mt-2",children:[(0,a.jsx)("td",{children:(0,a.jsx)(_.Z,{children:t})}),(0,a.jsx)("td",{children:(0,a.jsx)(A.Z,{className:"ml-5",value:r,min:0,step:1,onChange:e=>{e8(l=>{var s;let t=null!==(s=null==l?void 0:l[eF])&&void 0!==s?s:{};return{...null!=l?l:{},[eF]:{...t,[n]:e}}})}})})]},l)})})}),(0,a.jsx)(p.Z,{className:"mt-6 mr-8",onClick:ls,children:"Save"})]})]})]})})};let{Option:eE}=v.default;var eP=e=>{let{userID:l,accessToken:s,teams:t}=e,[n]=S.Z.useForm(),[i,o]=(0,r.useState)(!1),[d,c]=(0,r.useState)(null),[m,h]=(0,r.useState)([]);(0,r.useEffect)(()=>{(async()=>{try{let e=await (0,u.So)(s,l,"any"),t=[];for(let l=0;l{o(!1),n.resetFields()},g=()=>{o(!1),c(null),n.resetFields()},Z=async e=>{try{k.ZP.info("Making API Call"),o(!0),console.log("formValues in create user:",e);let t=await (0,u.Ov)(s,null,e);console.log("user create Response:",t),c(t.key),k.ZP.success("API user Created"),n.resetFields(),localStorage.removeItem("userData"+l)}catch(e){console.error("Error creating the user:",e)}};return(0,a.jsxs)("div",{children:[(0,a.jsx)(p.Z,{className:"mx-auto mb-0",onClick:()=>o(!0),children:"+ Invite User"}),(0,a.jsxs)(w.Z,{title:"Invite User",visible:i,width:800,footer:null,onOk:x,onCancel:g,children:[(0,a.jsx)(_.Z,{className:"mb-1",children:"Invite a user to login to the Admin UI and create Keys"}),(0,a.jsx)(_.Z,{className:"mb-6",children:(0,a.jsx)("b",{children:"Note: SSO Setup Required for this"})}),(0,a.jsxs)(S.Z,{form:n,onFinish:Z,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsx)(S.Z.Item,{label:"User Email",name:"user_email",children:(0,a.jsx)(j.Z,{placeholder:""})}),(0,a.jsx)(S.Z.Item,{label:"Team ID",name:"team_id",children:(0,a.jsx)(v.default,{placeholder:"Select Team ID",style:{width:"100%"},children:t?t.map(e=>(0,a.jsx)(eE,{value:e.team_id,children:e.team_alias},e.team_id)):(0,a.jsx)(eE,{value:null,children:"Default Team"},"default")})}),(0,a.jsx)(S.Z.Item,{label:"Metadata",name:"metadata",children:(0,a.jsx)(N.Z.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Create User"})})]})]}),d&&(0,a.jsxs)(w.Z,{title:"User Created Successfully",visible:i,onOk:x,onCancel:g,footer:null,children:[(0,a.jsx)("p",{children:"User has been created to access your proxy. Please Ask them to Log In."}),(0,a.jsx)("br",{}),(0,a.jsx)("p",{children:(0,a.jsx)("b",{children:"Note: This Feature is only supported through SSO on the Admin UI"})})]})]})},eT=e=>{let{accessToken:l,token:s,keys:t,userRole:n,userID:i,teams:o,setKeys:d}=e,[c,m]=(0,r.useState)(null),[h,p]=(0,r.useState)(null),[j,g]=(0,r.useState)(0),[Z,f]=r.useState(null),[y,b]=(0,r.useState)(null);return((0,r.useEffect)(()=>{if(!l||!s||!n||!i)return;let e=async()=>{try{let e=await (0,u.Br)(l,null,n,!0,j,25);console.log("user data response:",e),m(e)}catch(e){console.error("There was an error fetching the model data",e)}};l&&s&&n&&i&&e()},[l,s,n,i,j]),c&&l&&s&&n&&i)?(0,a.jsx)("div",{style:{width:"100%"},children:(0,a.jsxs)(x.Z,{className:"gap-2 p-2 h-[80vh] w-full mt-8",children:[(0,a.jsx)(eP,{userID:i,accessToken:l,teams:o}),(0,a.jsxs)(F.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[80vh] mb-4",children:[(0,a.jsx)("div",{className:"mb-4 mt-1",children:(0,a.jsx)(_.Z,{children:"These are Users on LiteLLM that created API Keys. Automatically tracked by LiteLLM"})}),(0,a.jsx)(en.Z,{children:(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsxs)(L.Z,{className:"mt-5",children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"User ID"}),(0,a.jsx)(B.Z,{children:"User Email"}),(0,a.jsx)(B.Z,{children:"User Models"}),(0,a.jsx)(B.Z,{children:"User Spend ($ USD)"}),(0,a.jsx)(B.Z,{children:"User Max Budget ($ USD)"}),(0,a.jsx)(B.Z,{children:"User API Key Aliases"})]})}),(0,a.jsx)(U.Z,{children:c.map(e=>{var l;return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.user_id}),(0,a.jsx)(D.Z,{children:e.user_email}),(0,a.jsx)(D.Z,{children:e.models&&e.models.length>0?e.models:"All Models"}),(0,a.jsx)(D.Z,{children:e.spend?null===(l=e.spend)||void 0===l?void 0:l.toFixed(2):0}),(0,a.jsx)(D.Z,{children:e.max_budget?e.max_budget:"Unlimited"}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(x.Z,{numItems:2,children:e&&e.key_aliases&&e.key_aliases.filter(e=>null!==e).length>0?(0,a.jsx)(R.Z,{size:"xs",color:"indigo",children:e.key_aliases.filter(e=>null!==e).join(", ")}):(0,a.jsx)(R.Z,{size:"xs",color:"gray",children:"No Keys"})})})]},e.user_id)})})]})}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsx)("div",{className:"flex-1 flex justify-between items-center"})]})})]})})]}),function(){if(!c)return null;let e=Math.ceil(c.length/25);return(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsxs)("div",{children:["Showing Page ",j+1," of ",e]}),(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)("button",{className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-l focus:outline-none",disabled:0===j,onClick:()=>g(j-1),children:"← Prev"}),(0,a.jsx)("button",{className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-r focus:outline-none",onClick:()=>{g(j+1)},children:"Next →"})]})]})}()]})}):(0,a.jsx)("div",{children:"Loading..."})},eO=e=>{let{teams:l,searchParams:s,accessToken:t,setTeams:n,userID:i,userRole:o}=e,[d]=S.Z.useForm(),[c]=S.Z.useForm(),{Title:m,Paragraph:g}=ee.default,[Z,f]=(0,r.useState)(""),[y,b]=(0,r.useState)(!1),[C,E]=(0,r.useState)(l?l[0]:null),[P,G]=(0,r.useState)(!1),[W,H]=(0,r.useState)(!1),[Y,J]=(0,r.useState)([]),[$,X]=(0,r.useState)(!1),[Q,el]=(0,r.useState)(null),[es,et]=(0,r.useState)({}),en=e=>{E(e),b(!0)},ea=async e=>{let s=e.team_id;if(console.log("handleEditSubmit:",e),null==t)return;let a=await (0,u.Gh)(t,e);l&&n(l.map(e=>e.team_id===s?a.data:e)),k.ZP.success("Team updated successfully"),b(!1),E(null)},er=async e=>{el(e),X(!0)},ei=async()=>{if(null!=Q&&null!=l&&null!=t){try{await (0,u.rs)(t,Q);let e=l.filter(e=>e.team_id!==Q);n(e)}catch(e){console.error("Error deleting the team:",e)}X(!1),el(null)}};(0,r.useEffect)(()=>{let e=async()=>{try{if(null===i||null===o||null===t||null===l)return;console.log("fetching team info:");let e={};for(let s=0;s<(null==l?void 0:l.length);s++){let n=l[s].team_id,a=await (0,u.Xm)(t,n);console.log("teamInfo response:",a),null!==a&&(e={...e,[n]:a})}et(e)}catch(e){console.error("Error fetching team info:",e)}};(async()=>{try{if(null===i||null===o)return;if(null!==t){let e=(await (0,u.So)(t,i,o)).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,o,l]);let eo=async e=>{try{if(null!=t){var s;let a=null==e?void 0:e.team_alias;if((null!==(s=null==l?void 0:l.map(e=>e.team_alias))&&void 0!==s?s:[]).includes(a))throw Error("Team alias ".concat(a," already exists, please pick another alias"));k.ZP.info("Creating Team");let r=await (0,u.hT)(t,e);null!==l?n([...l,r]):n([r]),console.log("response for team create call: ".concat(r)),k.ZP.success("Team created"),G(!1)}}catch(e){console.error("Error creating the team:",e),k.ZP.error("Error creating the team: "+e,20)}},ed=async e=>{try{if(null!=t&&null!=l){k.ZP.info("Adding Member");let s={role:"user",user_email:e.user_email,user_id:e.user_id},a=await (0,u.cu)(t,C.team_id,s);console.log("response for team create call: ".concat(a.data));let r=l.findIndex(e=>(console.log("team.team_id=".concat(e.team_id,"; response.data.team_id=").concat(a.data.team_id)),e.team_id===a.data.team_id));if(console.log("foundIndex: ".concat(r)),-1!==r){let e=[...l];e[r]=a.data,n(e),E(a.data)}H(!1)}}catch(e){console.error("Error creating the team:",e)}};return console.log("received teams ".concat(JSON.stringify(l))),(0,a.jsx)("div",{className:"w-full mx-4",children:(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)(m,{level:4,children:"All Teams"}),(0,a.jsxs)(F.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:[(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Team Name"}),(0,a.jsx)(B.Z,{children:"Spend (USD)"}),(0,a.jsx)(B.Z,{children:"Budget (USD)"}),(0,a.jsx)(B.Z,{children:"Models"}),(0,a.jsx)(B.Z,{children:"TPM / RPM Limits"}),(0,a.jsx)(B.Z,{children:"Info"})]})}),(0,a.jsx)(U.Z,{children:l&&l.length>0?l.map(e=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.team_alias}),(0,a.jsx)(D.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.spend}),(0,a.jsx)(D.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.max_budget?e.max_budget:"No limit"}),(0,a.jsx)(D.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},children:Array.isArray(e.models)?(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:0===e.models.length?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Proxy Models"})}):e.models.map((e,l)=>"all-proxy-models"===e?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Proxy Models"})},l):(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,a.jsx)(_.Z,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},l))}):null}),(0,a.jsx)(D.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:(0,a.jsxs)(_.Z,{children:["TPM: ",e.tpm_limit?e.tpm_limit:"Unlimited"," ",(0,a.jsx)("br",{}),"RPM:"," ",e.rpm_limit?e.rpm_limit:"Unlimited"]})}),(0,a.jsxs)(D.Z,{children:[(0,a.jsxs)(_.Z,{children:[es&&e.team_id&&es[e.team_id]&&es[e.team_id].keys&&es[e.team_id].keys.length," ","Keys"]}),(0,a.jsxs)(_.Z,{children:[es&&e.team_id&&es[e.team_id]&&es[e.team_id].team_info&&es[e.team_id].team_info.members_with_roles&&es[e.team_id].team_info.members_with_roles.length," ","Members"]})]}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(M.Z,{icon:T.Z,size:"sm",onClick:()=>en(e)}),(0,a.jsx)(M.Z,{onClick:()=>er(e.team_id),icon:O.Z,size:"sm"})]})]},e.team_id)):null})]}),$&&(0,a.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,a.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,a.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,a.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,a.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,a.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,a.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,a.jsx)("div",{className:"sm:flex sm:items-start",children:(0,a.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,a.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Team"}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this team ?"})})]})})}),(0,a.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,a.jsx)(p.Z,{onClick:ei,color:"red",className:"ml-2",children:"Delete"}),(0,a.jsx)(p.Z,{onClick:()=>{X(!1),el(null)},children:"Cancel"})]})]})]})})]})]}),(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)(p.Z,{className:"mx-auto",onClick:()=>G(!0),children:"+ Create New Team"}),(0,a.jsx)(w.Z,{title:"Create Team",visible:P,width:800,footer:null,onOk:()=>{G(!1),d.resetFields()},onCancel:()=>{G(!1),d.resetFields()},children:(0,a.jsxs)(S.Z,{form:d,onFinish:eo,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,a.jsx)(j.Z,{placeholder:""})}),(0,a.jsx)(S.Z.Item,{label:"Models",name:"models",children:(0,a.jsxs)(v.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,a.jsx)(v.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),Y.map(e=>(0,a.jsx)(v.default.Option,{value:e,children:e},e))]})}),(0,a.jsx)(S.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(A.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,a.jsx)(A.Z,{step:1,width:400})}),(0,a.jsx)(S.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,a.jsx)(A.Z,{step:1,width:400})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Create Team"})})]})})]}),(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)(m,{level:4,children:"Team Members"}),(0,a.jsx)(g,{children:"If you belong to multiple teams, this setting controls which teams members you see."}),l&&l.length>0?(0,a.jsx)(z.Z,{defaultValue:"0",children:l.map((e,l)=>(0,a.jsx)(V.Z,{value:String(l),onClick:()=>{E(e)},children:e.team_alias},l))}):(0,a.jsxs)(g,{children:["No team created. ",(0,a.jsx)("b",{children:"Defaulting to personal account."})]})]}),(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)(F.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Member Name"}),(0,a.jsx)(B.Z,{children:"Role"})]})}),(0,a.jsx)(U.Z,{children:C?C.members_with_roles.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.user_email?e.user_email:e.user_id?e.user_id:null}),(0,a.jsx)(D.Z,{children:e.role})]},l)):null})]})}),C&&(0,a.jsx)(e=>{let{visible:l,onCancel:s,team:t,onSubmit:n}=e,[r]=S.Z.useForm();return(0,a.jsx)(w.Z,{title:"Edit Team",visible:l,width:800,footer:null,onOk:()=>{r.validateFields().then(e=>{n({...e,team_id:t.team_id}),r.resetFields()}).catch(e=>{console.error("Validation failed:",e)})},onCancel:s,children:(0,a.jsxs)(S.Z,{form:r,onFinish:ea,initialValues:t,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,a.jsx)(j.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"Models",name:"models",children:(0,a.jsxs)(v.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,a.jsx)(v.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),Y&&Y.map(e=>(0,a.jsx)(v.default.Option,{value:e,children:e},e))]})}),(0,a.jsx)(S.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(A.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,a.jsx)(A.Z,{step:1,width:400})}),(0,a.jsx)(S.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,a.jsx)(A.Z,{step:1,width:400})}),(0,a.jsx)(S.Z.Item,{label:"Requests per minute Limit (RPM)",name:"team_id",hidden:!0})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Edit Team"})})]})})},{visible:y,onCancel:()=>{b(!1),E(null)},team:C,onSubmit:ea})]}),(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)(p.Z,{className:"mx-auto mb-5",onClick:()=>H(!0),children:"+ Add member"}),(0,a.jsx)(w.Z,{title:"Add member",visible:W,width:800,footer:null,onOk:()=>{H(!1),c.resetFields()},onCancel:()=>{H(!1),c.resetFields()},children:(0,a.jsxs)(S.Z,{form:d,onFinish:ed,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Email",name:"user_email",className:"mb-4",children:(0,a.jsx)(N.Z,{name:"user_email",className:"px-3 py-2 border rounded-md w-full"})}),(0,a.jsx)("div",{className:"text-center mb-4",children:"OR"}),(0,a.jsx)(S.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,a.jsx)(N.Z,{name:"user_id",className:"px-3 py-2 border rounded-md w-full"})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Add member"})})]})})]})]})})},eR=e=>{let l,{searchParams:s,accessToken:t,showSSOBanner:n}=e,[i]=S.Z.useForm(),[o]=S.Z.useForm(),{Title:d,Paragraph:c}=ee.default,[m,j]=(0,r.useState)(""),[g,Z]=(0,r.useState)(null),[f,y]=(0,r.useState)(!1),[b,v]=(0,r.useState)(!1),[A,C]=(0,r.useState)(!1),[E,P]=(0,r.useState)(!1),[O,R]=(0,r.useState)(!1);try{l=window.location.origin}catch(e){l=""}l+="/fallback/login";let G=()=>{R(!1)},W=["proxy_admin","proxy_admin_viewer"];(0,r.useEffect)(()=>{(async()=>{if(null!=t){let e=[],l=await (0,u.Xd)(t,"proxy_admin_viewer");l.forEach(l=>{e.push({user_role:l.user_role,user_id:l.user_id,user_email:l.user_email})}),console.log("proxy viewers: ".concat(l));let s=await (0,u.Xd)(t,"proxy_admin");s.forEach(l=>{e.push({user_role:l.user_role,user_id:l.user_id,user_email:l.user_email})}),console.log("proxy admins: ".concat(s)),console.log("combinedList: ".concat(e)),Z(e)}})()},[t]);let H=()=>{C(!1),o.resetFields()},Y=()=>{C(!1),o.resetFields()},J=e=>(0,a.jsxs)(S.Z,{form:i,onFinish:e,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Email",name:"user_email",className:"mb-4",children:(0,a.jsx)(N.Z,{name:"user_email",className:"px-3 py-2 border rounded-md w-full"})}),(0,a.jsx)("div",{className:"text-center mb-4",children:"OR"}),(0,a.jsx)(S.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,a.jsx)(N.Z,{name:"user_id",className:"px-3 py-2 border rounded-md w-full"})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Add member"})})]}),$=(e,l,s)=>(0,a.jsxs)(S.Z,{form:i,onFinish:e,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"User Role",name:"user_role",labelCol:{span:10},labelAlign:"left",children:(0,a.jsx)(z.Z,{value:l,children:W.map((e,l)=>(0,a.jsx)(V.Z,{value:e,children:e},l))})}),(0,a.jsx)(S.Z.Item,{label:"Team ID",name:"user_id",hidden:!0,initialValue:s,valuePropName:"user_id",className:"mt-8",children:(0,a.jsx)(N.Z,{value:s,disabled:!0})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Update role"})})]}),X=async e=>{try{if(null!=t&&null!=g){k.ZP.info("Making API Call");let l=await (0,u.pf)(t,e,null);console.log("response for team create call: ".concat(l));let s=g.findIndex(e=>(console.log("user.user_id=".concat(e.user_id,"; response.user_id=").concat(l.user_id)),e.user_id===l.user_id));console.log("foundIndex: ".concat(s)),-1==s&&(console.log("updates admin with new user"),g.push(l),Z(g)),k.ZP.success("Refresh tab to see updated user role"),C(!1)}}catch(e){console.error("Error creating the key:",e)}},Q=async e=>{try{if(null!=t&&null!=g){k.ZP.info("Making API Call");let l=await (0,u.pf)(t,e,"proxy_admin_viewer");console.log("response for team create call: ".concat(l));let s=g.findIndex(e=>(console.log("user.user_id=".concat(e.user_id,"; response.user_id=").concat(l.user_id)),e.user_id===l.user_id));console.log("foundIndex: ".concat(s)),-1==s&&(console.log("updates admin with new user"),g.push(l),Z(g)),y(!1)}}catch(e){console.error("Error creating the key:",e)}},el=async e=>{try{if(null!=t&&null!=g){k.ZP.info("Making API Call"),e.user_email,e.user_id;let l=await (0,u.pf)(t,e,"proxy_admin");console.log("response for team create call: ".concat(l));let s=g.findIndex(e=>(console.log("user.user_id=".concat(e.user_id,"; response.user_id=").concat(l.user_id)),e.user_id===l.user_id));console.log("foundIndex: ".concat(s)),-1==s&&(console.log("updates admin with new user"),g.push(l),Z(g)),v(!1)}}catch(e){console.error("Error creating the key:",e)}},es=async e=>{if(null==t)return;let l={environment_variables:{PROXY_BASE_URL:e.proxy_base_url,GOOGLE_CLIENT_ID:e.google_client_id,GOOGLE_CLIENT_SECRET:e.google_client_secret}};(0,u.K_)(t,l)};return console.log("admins: ".concat(null==g?void 0:g.length)),(0,a.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,a.jsx)(d,{level:4,children:"Admin Access "}),(0,a.jsxs)(c,{children:[n&&(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/ui#restrict-ui-access",children:"Requires SSO Setup"}),(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Proxy Admin: "})," Can create keys, teams, users, add models, etc. ",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Proxy Admin Viewer: "}),"Can just view spend. They cannot create keys, teams or grant users access to new models."," "]}),(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 p-2 w-full",children:[(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsx)(F.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Member Name"}),(0,a.jsx)(B.Z,{children:"Role"})]})}),(0,a.jsx)(U.Z,{children:g?g.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.user_email?e.user_email:e.user_id?e.user_id:null}),(0,a.jsx)(D.Z,{children:e.user_role}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(M.Z,{icon:T.Z,size:"sm",onClick:()=>C(!0)}),(0,a.jsx)(w.Z,{title:"Update role",visible:A,width:800,footer:null,onOk:H,onCancel:Y,children:$(X,e.user_role,e.user_id)})]})]},l)):null})]})})}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)("div",{className:"flex justify-start",children:[(0,a.jsx)(p.Z,{className:"mr-4 mb-5",onClick:()=>v(!0),children:"+ Add admin"}),(0,a.jsx)(w.Z,{title:"Add admin",visible:b,width:800,footer:null,onOk:()=>{v(!1),o.resetFields()},onCancel:()=>{v(!1),o.resetFields()},children:J(el)}),(0,a.jsx)(p.Z,{className:"mb-5",onClick:()=>y(!0),children:"+ Add viewer"}),(0,a.jsx)(w.Z,{title:"Add viewer",visible:f,width:800,footer:null,onOk:()=>{y(!1),o.resetFields()},onCancel:()=>{y(!1),o.resetFields()},children:J(Q)})]})})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsx)(d,{level:4,children:"Add SSO"}),(0,a.jsxs)("div",{className:"flex justify-start mb-4",children:[(0,a.jsx)(p.Z,{onClick:()=>P(!0),children:"Add SSO"}),(0,a.jsx)(w.Z,{title:"Add SSO",visible:E,width:800,footer:null,onOk:()=>{P(!1),i.resetFields()},onCancel:()=>{P(!1),i.resetFields()},children:(0,a.jsxs)(S.Z,{form:i,onFinish:e=>{el(e),es(e),P(!1),R(!0)},labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Admin Email",name:"user_email",rules:[{required:!0,message:"Please enter the email of the proxy admin"}],children:(0,a.jsx)(N.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"PROXY BASE URL",name:"proxy_base_url",rules:[{required:!0,message:"Please enter the proxy base url"}],children:(0,a.jsx)(N.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"GOOGLE CLIENT ID",name:"google_client_id",rules:[{required:!0,message:"Please enter the google client id"}],children:(0,a.jsx)(N.Z.Password,{})}),(0,a.jsx)(S.Z.Item,{label:"GOOGLE CLIENT SECRET",name:"google_client_secret",rules:[{required:!0,message:"Please enter the google client secret"}],children:(0,a.jsx)(N.Z.Password,{})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Save"})})]})}),(0,a.jsxs)(w.Z,{title:"SSO Setup Instructions",visible:O,width:800,footer:null,onOk:G,onCancel:()=>{R(!1)},children:[(0,a.jsx)("p",{children:"Follow these steps to complete the SSO setup:"}),(0,a.jsx)(_.Z,{className:"mt-2",children:"1. DO NOT Exit this TAB"}),(0,a.jsx)(_.Z,{className:"mt-2",children:"2. Open a new tab, visit your proxy base url"}),(0,a.jsx)(_.Z,{className:"mt-2",children:"3. Confirm your SSO is configured correctly and you can login on the new Tab"}),(0,a.jsx)(_.Z,{className:"mt-2",children:"4. If Step 3 is successful, you can close this tab"}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{onClick:G,children:"Done"})})]})]}),(0,a.jsxs)(e_.Z,{title:"Login without SSO",color:"teal",children:["If you need to login without sso, you can access ",(0,a.jsxs)("a",{href:l,target:"_blank",children:[(0,a.jsx)("b",{children:l})," "]})]})]})]})},eF=s(42556),eM=s(90252),eL=e=>{let{alertingSettings:l,handleInputChange:s,handleResetField:t,handleSubmit:n,premiumUser:r}=e,[i]=S.Z.useForm();return(0,a.jsxs)(S.Z,{form:i,onFinish:()=>{let e=i.getFieldsValue();Object.values(e).some(e=>""===e||null==e)?console.log("Some form fields are empty."):n(e)},labelAlign:"left",children:[l.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsxs)(D.Z,{align:"center",children:[(0,a.jsx)(_.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)(D.Z,{children:"Integer"===e.field_type?(0,a.jsx)(A.Z,{step:1,value:e.field_value,onChange:l=>s(e.field_name,l)}):(0,a.jsx)(N.Z,{value:e.field_value,onChange:l=>s(e.field_name,l)})})}):(0,a.jsx)(D.Z,{children:(0,a.jsx)(p.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",children:(0,a.jsx)(D.Z,{children:"Integer"===e.field_type?(0,a.jsx)(A.Z,{step:1,value:e.field_value,onChange:l=>s(e.field_name,l),className:"p-0"}):(0,a.jsx)(N.Z,{value:e.field_value,onChange:l=>s(e.field_name,l)})})}),(0,a.jsx)(D.Z,{children:!0==e.stored_in_db?(0,a.jsx)(R.Z,{icon:eM.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,a.jsx)(R.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,a.jsx)(R.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(M.Z,{icon:O.Z,color:"red",onClick:()=>t(e.field_name,l),children:"Reset"})})]},l)),(0,a.jsx)("div",{children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Update Settings"})})]})},eU=e=>{let{accessToken:l,premiumUser:s}=e,[t,n]=(0,r.useState)([]);return console.log("INSIDE ALERTING SETTINGS"),(0,r.useEffect)(()=>{l&&(0,u.RQ)(l).then(e=>{n(e)})},[l]),(0,a.jsx)(eL,{alertingSettings:t,handleInputChange:(e,l)=>{n(t.map(s=>s.field_name===e?{...s,field_value:l}: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);console.log("INSIDE HANDLE RESET FIELD"),n(l)}catch(e){console.log("ERROR OCCURRED!")}},handleSubmit:e=>{if(!l||null==e||void 0==e)return;let s={};t.forEach(e=>{s[e.field_name]=e.field_value});let n={...e,...s};try{(0,u.jA)(l,"alerting_args",n),k.ZP.success("Wait 10s for proxy to update.")}catch(e){}},premiumUser:s})};let eD=[{name:"slack",variables:{LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:null,LANGFUSE_SECRET_KEY:null,OPENMETER_API_KEY:null,SLACK_WEBHOOK_URL:null}},{name:"langfuse",variables:{LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:null,LANGFUSE_SECRET_KEY:null,OPENMETER_API_KEY:null,SLACK_WEBHOOK_URL:null}},{name:"openmeter",variables:{LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:null,LANGFUSE_SECRET_KEY:null,OPENMETER_API_KEY:null,SLACK_WEBHOOK_URL:null}}];var eK=e=>{let{accessToken:l,userRole:s,userID:t,premiumUser:n}=e,[i,o]=(0,r.useState)(eD),[d,c]=(0,r.useState)([]),[m,h]=(0,r.useState)(!1),[g]=S.Z.useForm(),[Z,f]=(0,r.useState)(null),[y,b]=(0,r.useState)([]),[N,A]=(0,r.useState)(""),[C,E]=(0,r.useState)({}),[P,T]=(0,r.useState)([]),O=e=>{P.includes(e)?T(P.filter(l=>l!==e)):T([...P,e])},M={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,r.useEffect)(()=>{l&&s&&t&&(0,u.BL)(l,t,s).then(e=>{console.log("callbacks",e);let l=eD;o(l=l.map(l=>{let s=e.callbacks.find(e=>e.name===l.name);return s?{...l,variables:{...l.variables,...s.variables}}:l}));let s=e.alerts;if(console.log("alerts_data",s),s&&s.length>0){let e=s[0];console.log("_alert_info",e);let l=e.variables.SLACK_WEBHOOK_URL;console.log("catch_all_webhook",l),T(e.active_alerts),A(l),E(e.alerts_to_webhook)}c(s)})},[l,s,t]);let z=e=>P&&P.includes(e),V=e=>{if(!l)return;let s=Object.fromEntries(Object.entries(e.variables).map(e=>{var l;let[s,t]=e;return[s,(null===(l=document.querySelector('input[name="'.concat(s,'"]')))||void 0===l?void 0:l.value)||t]}));console.log("updatedVariables",s),console.log("updateAlertTypes",y);let t={environment_variables:s,litellm_settings:{success_callback:[e.name]}};try{(0,u.K_)(l,t)}catch(e){k.ZP.error("Failed to update callback: "+e,20)}k.ZP.success("Callback updated successfully")},G=()=>{l&&g.validateFields().then(e=>{let s;if(console.log("Form values:",e),"langfuse"===e.callback){s={environment_variables:{LANGFUSE_PUBLIC_KEY:e.langfusePublicKey,LANGFUSE_SECRET_KEY:e.langfusePrivateKey},litellm_settings:{success_callback:[e.callback]}},(0,u.K_)(l,s);let t={name:e.callback,variables:{SLACK_WEBHOOK_URL:null,LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:e.langfusePublicKey,LANGFUSE_SECRET_KEY:e.langfusePrivateKey,OPENMETER_API_KEY:null}};o(i?[...i,t]:[t])}else if("slack"===e.callback){console.log("values.slackWebhookUrl: ".concat(e.slackWebhookUrl)),s={general_settings:{alerting:["slack"],alerting_threshold:300},environment_variables:{SLACK_WEBHOOK_URL:e.slackWebhookUrl}},(0,u.K_)(l,s),console.log("values.callback: ".concat(e.callback));let t={name:e.callback,variables:{SLACK_WEBHOOK_URL:e.slackWebhookUrl,LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:null,LANGFUSE_SECRET_KEY:null,OPENMETER_API_KEY:null}};o(i?[...i,t]:[t])}else if("openmeter"==e.callback){console.log("values.openMeterApiKey: ".concat(e.openMeterApiKey)),s={environment_variables:{OPENMETER_API_KEY:e.openMeterApiKey},litellm_settings:{success_callback:[e.callback]}},(0,u.K_)(l,s);let t={name:e.callback,variables:{SLACK_WEBHOOK_URL:null,LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:null,LANGFUSE_SECRET_KEY:null,OPENMETER_API_KEY:e.openMeterAPIKey}};o(i?[...i,t]:[t])}else s={error:"Invalid callback value"};h(!1),g.resetFields(),f(null)})};return l?(console.log("callbacks: ".concat(i)),(0,a.jsxs)("div",{className:"w-full mx-4",children:[(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:[(0,a.jsx)(e_.Z,{title:"[UI] Presidio PII + Guardrails Coming Soon. https://docs.litellm.ai/docs/proxy/pii_masking",color:"sky"}),(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{variant:"line",defaultValue:"1",children:[(0,a.jsx)(et.Z,{value:"1",children:"Logging Callbacks"}),(0,a.jsx)(et.Z,{value:"2",children:"Alerting Types"}),(0,a.jsx)(et.Z,{value:"2",children:"Alerting Settings"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsx)(F.Z,{children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Callback"}),(0,a.jsx)(B.Z,{children:"Callback Env Vars"})]})}),(0,a.jsx)(U.Z,{children:i.filter(e=>"slack"!==e.name).map((e,s)=>{var t;return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:(0,a.jsx)(R.Z,{color:"emerald",children:e.name})}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)("ul",{children:Object.entries(null!==(t=e.variables)&&void 0!==t?t:{}).filter(l=>{let[s,t]=l;return s.toLowerCase().includes(e.name)}).map(e=>{let[l,s]=e;return(0,a.jsxs)("li",{children:[(0,a.jsx)(_.Z,{className:"mt-2",children:l}),"LANGFUSE_HOST"===l?(0,a.jsx)("p",{children:"default value=https://cloud.langfuse.com"}):(0,a.jsx)("div",{}),(0,a.jsx)(j.Z,{name:l,defaultValue:s,type:"password"})]},l)})}),(0,a.jsx)(p.Z,{className:"mt-2",onClick:()=>V(e),children:"Save Changes"}),(0,a.jsx)(p.Z,{onClick:()=>(0,u.jE)(l,e.name),className:"mx-2",children:"Test Callback"})]})]},s)})})]})})}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(F.Z,{children:[(0,a.jsxs)(_.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)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{}),(0,a.jsx)(B.Z,{}),(0,a.jsx)(B.Z,{children:"Slack Webhook URL"})]})}),(0,a.jsx)(U.Z,{children:Object.entries(M).map((e,l)=>{let[s,t]=e;return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:"region_outage_alerts"==s?n?(0,a.jsx)(eF.Z,{id:"switch",name:"switch",checked:z(s),onChange:()=>O(s)}):(0,a.jsx)(p.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)(eF.Z,{id:"switch",name:"switch",checked:z(s),onChange:()=>O(s)})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(_.Z,{children:t})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(j.Z,{name:s,type:"password",defaultValue:C&&C[s]?C[s]:N})})]},l)})})]}),(0,a.jsx)(p.Z,{size:"xs",className:"mt-2",onClick:()=>{if(!l)return;let e={};Object.entries(M).forEach(l=>{let[s,t]=l,n=document.querySelector('input[name="'.concat(s,'"]'));console.log("key",s),console.log("webhookInput",n);let a=(null==n?void 0:n.value)||"";console.log("newWebhookValue",a),e[s]=a}),console.log("updatedAlertToWebhooks",e);let s={general_settings:{alert_to_webhook_url:e,alert_types:P}};console.log("payload",s);try{(0,u.K_)(l,s)}catch(e){k.ZP.error("Failed to update alerts: "+e,20)}k.ZP.success("Alerts updated successfully")},children:"Save Changes"}),(0,a.jsx)(p.Z,{onClick:()=>(0,u.jE)(l,"slack"),className:"mx-2",children:"Test Alerts"})]})}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eU,{accessToken:l,premiumUser:n})})]})]})]}),(0,a.jsx)(w.Z,{title:"Add Callback",visible:m,onOk:G,width:800,onCancel:()=>{h(!1),g.resetFields(),f(null)},footer:null,children:(0,a.jsxs)(S.Z,{form:g,layout:"vertical",onFinish:G,children:[(0,a.jsx)(S.Z.Item,{label:"Callback",name:"callback",rules:[{required:!0,message:"Please select a callback"}],children:(0,a.jsxs)(v.default,{onChange:e=>{f(e)},children:[(0,a.jsx)(v.default.Option,{value:"langfuse",children:"langfuse"}),(0,a.jsx)(v.default.Option,{value:"openmeter",children:"openmeter"})]})}),"langfuse"===Z&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"LANGFUSE_PUBLIC_KEY",name:"langfusePublicKey",rules:[{required:!0,message:"Please enter the public key"}],children:(0,a.jsx)(j.Z,{type:"password"})}),(0,a.jsx)(S.Z.Item,{label:"LANGFUSE_PRIVATE_KEY",name:"langfusePrivateKey",rules:[{required:!0,message:"Please enter the private key"}],children:(0,a.jsx)(j.Z,{type:"password"})})]}),"openmeter"==Z&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(S.Z.Item,{label:"OPENMETER_API_KEY",name:"openMeterApiKey",rules:[{required:!0,message:"Please enter the openmeter api key"}],children:(0,a.jsx)(j.Z,{type:"password"})})}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Save"})})]})})]})):null};let{Option:eB}=v.default;var eq=e=>{let{models:l,accessToken:s,routerSettings:t,setRouterSettings:n}=e,[i]=S.Z.useForm(),[o,d]=(0,r.useState)(!1),[c,m]=(0,r.useState)("");return(0,a.jsxs)("div",{children:[(0,a.jsx)(p.Z,{className:"mx-auto",onClick:()=>d(!0),children:"+ Add Fallbacks"}),(0,a.jsx)(w.Z,{title:"Add Fallbacks",visible:o,width:800,footer:null,onOk:()=>{d(!1),i.resetFields()},onCancel:()=>{d(!1),i.resetFields()},children:(0,a.jsxs)(S.Z,{form:i,onFinish:e=>{console.log(e);let{model_name:l,models:a}=e,r=[...t.fallbacks||[],{[l]:a}],o={...t,fallbacks:r};console.log(o);try{(0,u.K_)(s,{router_settings:o}),n(o)}catch(e){k.ZP.error("Failed to update router settings: "+e,20)}k.ZP.success("router settings updated successfully"),d(!1),i.resetFields()},labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Public Model Name",name:"model_name",rules:[{required:!0,message:"Set the model to fallback for"}],help:"required",children:(0,a.jsx)(z.Z,{defaultValue:c,children:l&&l.map((e,l)=>(0,a.jsx)(V.Z,{value:e,onClick:()=>m(e),children:e},l))})}),(0,a.jsx)(S.Z.Item,{label:"Fallback Models",name:"models",rules:[{required:!0,message:"Please select a model"}],help:"required",children:(0,a.jsx)(eo.Z,{value:l,children:l&&l.filter(e=>e!=c).map(e=>(0,a.jsx)(ed.Z,{value:e,children:e},e))})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Add Fallbacks"})})]})})]})},ez=s(12968);async function eV(e,l){console.log("isLocal:",!1);let s=window.location.origin,t=new ez.ZP.OpenAI({apiKey:l,baseURL:s,dangerouslyAllowBrowser:!0});try{let l=await t.chat.completions.create({model:e,messages:[{role:"user",content:"Hi, this is a test message"}],mock_testing_fallbacks:!0});k.ZP.success((0,a.jsxs)("span",{children:["Test model=",(0,a.jsx)("strong",{children:e}),", received model=",(0,a.jsx)("strong",{children:l.model}),". See"," ",(0,a.jsx)("a",{href:"#",onClick:()=>window.open("https://docs.litellm.ai/docs/proxy/reliability","_blank"),style:{textDecoration:"underline",color:"blue"},children:"curl"})]}))}catch(e){k.ZP.error("Error occurred while generating model response. Please try again. Error: ".concat(e),20)}}let eG={ttl:3600,lowest_latency_buffer:0},eW=e=>{let{selectedStrategy:l,strategyArgs:s,paramExplanation:t}=e;return(0,a.jsxs)(g.Z,{children:[(0,a.jsx)(f.Z,{className:"text-sm font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Routing Strategy Specific Args"}),(0,a.jsx)(Z.Z,{children:"latency-based-routing"==l?(0,a.jsx)(F.Z,{children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Setting"}),(0,a.jsx)(B.Z,{children:"Value"})]})}),(0,a.jsx)(U.Z,{children:Object.entries(s).map(e=>{let[l,s]=e;return(0,a.jsxs)(q.Z,{children:[(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(_.Z,{children:l}),(0,a.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:t[l]})]}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(j.Z,{name:l,defaultValue:"object"==typeof s?JSON.stringify(s,null,2):s.toString()})})]},l)})})]})}):(0,a.jsx)(_.Z,{children:"No specific settings"})})]})};var eH=e=>{let{accessToken:l,userRole:s,userID:t,modelData:n}=e,[i,o]=(0,r.useState)({}),[d,c]=(0,r.useState)({}),[m,g]=(0,r.useState)([]),[Z,f]=(0,r.useState)(!1),[b]=S.Z.useForm(),[v,w]=(0,r.useState)(null),[N,I]=(0,r.useState)(null),[C,E]=(0,r.useState)(null),P={routing_strategy_args:"(dict) Arguments to pass to the routing strategy",routing_strategy:"(string) Routing strategy to use",allowed_fails:"(int) Number of times a deployment can fail before being added to cooldown",cooldown_time:"(int) time in seconds to cooldown a deployment after failure",num_retries:"(int) Number of retries for failed requests. Defaults to 0.",timeout:"(float) Timeout for requests. Defaults to None.",retry_after:"(int) Minimum time to wait before retrying a failed request",ttl:"(int) Sliding window to look back over when calculating the average latency of a deployment. Default - 1 hour (in seconds).",lowest_latency_buffer:"(float) Shuffle between deployments within this % of the lowest latency. Default - 0 (i.e. always pick lowest latency)."};(0,r.useEffect)(()=>{l&&s&&t&&((0,u.BL)(l,t,s).then(e=>{console.log("callbacks",e),o(e.router_settings)}),(0,u.YU)(l).then(e=>{g(e)}))},[l,s,t]);let T=async e=>{if(l){console.log("received key: ".concat(e)),console.log("routerSettings['fallbacks']: ".concat(i.fallbacks)),i.fallbacks.map(l=>(e in l&&delete l[e],l));try{await (0,u.K_)(l,{router_settings:i}),o({...i}),I(i.routing_strategy),k.ZP.success("Router settings updated successfully")}catch(e){k.ZP.error("Failed to update router settings: "+e,20)}}},G=(e,l)=>{g(m.map(s=>s.field_name===e?{...s,field_value:l}:s))},W=(e,s)=>{if(!l)return;let t=m[s].field_value;if(null!=t&&void 0!=t)try{(0,u.jA)(l,e,t);let s=m.map(l=>l.field_name===e?{...l,stored_in_db:!0}:l);g(s)}catch(e){}},H=(e,s)=>{if(l)try{(0,u.ao)(l,e);let s=m.map(l=>l.field_name===e?{...l,stored_in_db:null,field_value:null}:l);g(s)}catch(e){}},Y=e=>{if(!l)return;console.log("router_settings",e);let s=Object.fromEntries(Object.entries(e).map(e=>{let[l,s]=e;if("routing_strategy_args"!==l&&"routing_strategy"!==l){var t;return[l,(null===(t=document.querySelector('input[name="'.concat(l,'"]')))||void 0===t?void 0:t.value)||s]}if("routing_strategy"==l)return[l,N];if("routing_strategy_args"==l&&"latency-based-routing"==N){let e={},l=document.querySelector('input[name="lowest_latency_buffer"]'),s=document.querySelector('input[name="ttl"]');return(null==l?void 0:l.value)&&(e.lowest_latency_buffer=Number(l.value)),(null==s?void 0:s.value)&&(e.ttl=Number(s.value)),console.log("setRoutingStrategyArgs: ".concat(e)),["routing_strategy_args",e]}return null}).filter(e=>null!=e));console.log("updatedVariables",s);try{(0,u.K_)(l,{router_settings:s})}catch(e){k.ZP.error("Failed to update router settings: "+e,20)}k.ZP.success("router settings updated successfully")};return l?(0,a.jsx)("div",{className:"w-full mx-4",children:(0,a.jsxs)(en.Z,{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,a.jsxs)(ea.Z,{variant:"line",defaultValue:"1",children:[(0,a.jsx)(et.Z,{value:"1",children:"Loadbalancing"}),(0,a.jsx)(et.Z,{value:"2",children:"Fallbacks"}),(0,a.jsx)(et.Z,{value:"3",children:"General"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:[(0,a.jsx)(y.Z,{children:"Router Settings"}),(0,a.jsxs)(F.Z,{children:[(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Setting"}),(0,a.jsx)(B.Z,{children:"Value"})]})}),(0,a.jsx)(U.Z,{children:Object.entries(i).filter(e=>{let[l,s]=e;return"fallbacks"!=l&&"context_window_fallbacks"!=l&&"routing_strategy_args"!=l}).map(e=>{let[l,s]=e;return(0,a.jsxs)(q.Z,{children:[(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(_.Z,{children:l}),(0,a.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:P[l]})]}),(0,a.jsx)(D.Z,{children:"routing_strategy"==l?(0,a.jsxs)(z.Z,{defaultValue:s,className:"w-full max-w-md",onValueChange:I,children:[(0,a.jsx)(V.Z,{value:"usage-based-routing",children:"usage-based-routing"}),(0,a.jsx)(V.Z,{value:"latency-based-routing",children:"latency-based-routing"}),(0,a.jsx)(V.Z,{value:"simple-shuffle",children:"simple-shuffle"})]}):(0,a.jsx)(j.Z,{name:l,defaultValue:"object"==typeof s?JSON.stringify(s,null,2):s.toString()})})]},l)})})]}),(0,a.jsx)(eW,{selectedStrategy:N,strategyArgs:i&&i.routing_strategy_args&&Object.keys(i.routing_strategy_args).length>0?i.routing_strategy_args:eG,paramExplanation:P})]}),(0,a.jsx)(h.Z,{children:(0,a.jsx)(p.Z,{className:"mt-2",onClick:()=>Y(i),children:"Save Changes"})})]})}),(0,a.jsxs)(er.Z,{children:[(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Model Name"}),(0,a.jsx)(B.Z,{children:"Fallbacks"})]})}),(0,a.jsx)(U.Z,{children:i.fallbacks&&i.fallbacks.map((e,s)=>Object.entries(e).map(e=>{let[t,n]=e;return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:t}),(0,a.jsx)(D.Z,{children:Array.isArray(n)?n.join(", "):n}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(p.Z,{onClick:()=>eV(t,l),children:"Test Fallback"})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(M.Z,{icon:O.Z,size:"sm",onClick:()=>T(t)})})]},s.toString()+t)}))})]}),(0,a.jsx)(eq,{models:(null==n?void 0:n.data)?n.data.map(e=>e.model_name):[],accessToken:l,routerSettings:i,setRouterSettings:o})]}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(F.Z,{children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Setting"}),(0,a.jsx)(B.Z,{children:"Value"}),(0,a.jsx)(B.Z,{children:"Status"}),(0,a.jsx)(B.Z,{children:"Action"})]})}),(0,a.jsx)(U.Z,{children:m.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(_.Z,{children:e.field_name}),(0,a.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:e.field_description})]}),(0,a.jsx)(D.Z,{children:"Integer"==e.field_type?(0,a.jsx)(A.Z,{step:1,value:e.field_value,onChange:l=>G(e.field_name,l)}):null}),(0,a.jsx)(D.Z,{children:!0==e.stored_in_db?(0,a.jsx)(R.Z,{icon:eM.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,a.jsx)(R.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,a.jsx)(R.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(p.Z,{onClick:()=>W(e.field_name,l),children:"Update"}),(0,a.jsx)(M.Z,{icon:O.Z,color:"red",onClick:()=>H(e.field_name,l),children:"Reset"})]})]},l))})]})})})]})]})}):null},eY=e=>{let{isModalVisible:l,accessToken:s,setIsModalVisible:t,setBudgetList:n}=e,[r]=S.Z.useForm(),i=async e=>{if(null!=s&&void 0!=s)try{k.ZP.info("Making API Call");let l=await (0,u.Zr)(s,e);console.log("key create Response:",l),n(e=>e?[...e,l]:[l]),k.ZP.success("API Key Created"),r.resetFields()}catch(e){console.error("Error creating the key:",e),k.ZP.error("Error creating the key: ".concat(e),20)}};return(0,a.jsx)(w.Z,{title:"Create Budget",visible:l,width:800,footer:null,onOk:()=>{t(!1),r.resetFields()},onCancel:()=>{t(!1),r.resetFields()},children:(0,a.jsxs)(S.Z,{form:r,onFinish:i,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Budget ID",name:"budget_id",rules:[{required:!0,message:"Please input a human-friendly name for the budget"}],help:"A human-friendly name for the budget",children:(0,a.jsx)(j.Z,{placeholder:""})}),(0,a.jsx)(S.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,a.jsx)(A.Z,{step:1,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,a.jsx)(A.Z,{step:1,precision:2,width:200})}),(0,a.jsxs)(g.Z,{className:"mt-20 mb-8",children:[(0,a.jsx)(f.Z,{children:(0,a.jsx)("b",{children:"Optional Settings"})}),(0,a.jsxs)(Z.Z,{children:[(0,a.jsx)(S.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(A.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,a.jsxs)(v.default,{defaultValue:null,placeholder:"n/a",children:[(0,a.jsx)(v.default.Option,{value:"24h",children:"daily"}),(0,a.jsx)(v.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Create Budget"})})]})})},eJ=e=>{let{accessToken:l}=e,[s,t]=(0,r.useState)(!1),[n,i]=(0,r.useState)([]);(0,r.useEffect)(()=>{l&&(0,u.O3)(l).then(e=>{i(e)})},[l]);let o=async(e,s)=>{if(null==l)return;k.ZP.info("Request made"),await (0,u.NV)(l,e);let t=[...n];t.splice(s,1),i(t),k.ZP.success("Budget Deleted.")};return(0,a.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,a.jsx)(p.Z,{size:"sm",variant:"primary",className:"mb-2",onClick:()=>t(!0),children:"+ Create Budget"}),(0,a.jsx)(eY,{accessToken:l,isModalVisible:s,setIsModalVisible:t,setBudgetList:i}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(_.Z,{children:"Create a budget to assign to customers."}),(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Budget ID"}),(0,a.jsx)(B.Z,{children:"Max Budget"}),(0,a.jsx)(B.Z,{children:"TPM"}),(0,a.jsx)(B.Z,{children:"RPM"})]})}),(0,a.jsx)(U.Z,{children:n.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.budget_id}),(0,a.jsx)(D.Z,{children:e.max_budget?e.max_budget:"n/a"}),(0,a.jsx)(D.Z,{children:e.tpm_limit?e.tpm_limit:"n/a"}),(0,a.jsx)(D.Z,{children:e.rpm_limit?e.rpm_limit:"n/a"}),(0,a.jsx)(M.Z,{icon:O.Z,size:"sm",onClick:()=>o(e.budget_id,l)})]},l))})]})]}),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)(_.Z,{className:"text-base",children:"How to use budget id"}),(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{children:[(0,a.jsx)(et.Z,{children:"Assign Budget to Customer"}),(0,a.jsx)(et.Z,{children:"Test it (Curl)"}),(0,a.jsx)(et.Z,{children:"Test it (OpenAI SDK)"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"bash",children:"\ncurl -X POST --location '/end_user/new' \n-H 'Authorization: Bearer ' \n-H 'Content-Type: application/json' \n-d '{\"user_id\": \"my-customer-id', \"budget_id\": \"\"}' # \uD83D\uDC48 KEY CHANGE\n\n "})}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"bash",children:'\ncurl -X POST --location \'/chat/completions\' \n-H \'Authorization: Bearer \' \n-H \'Content-Type: application/json\' \n-d \'{\n "model": "gpt-3.5-turbo\', \n "messages":[{"role": "user", "content": "Hey, how\'s it going?"}],\n "user": "my-customer-id"\n}\' # \uD83D\uDC48 KEY CHANGE\n\n '})}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"python",children:'from openai import OpenAI\nclient = OpenAI(\n base_url="{let{}=e;return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(x.Z,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,a.jsxs)("div",{className:"mb-5",children:[(0,a.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:"OpenAI Compatible Proxy: API Reference"}),(0,a.jsx)(_.Z,{className:"mt-2 mb-2",children:"LiteLLM is OpenAI Compatible. This means your API Key works with the OpenAI SDK. Just replace the base_url to point to your litellm proxy. Example Below "}),(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{children:[(0,a.jsx)(et.Z,{children:"OpenAI Python SDK"}),(0,a.jsx)(et.Z,{children:"LlamaIndex"}),(0,a.jsx)(et.Z,{children:"Langchain Py"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"python",children:'\nimport openai\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="http://0.0.0.0:4000" # LiteLLM Proxy is OpenAI compatible, Read More: https://docs.litellm.ai/docs/proxy/user_keys\n)\n\nresponse = client.chat.completions.create(\n model="gpt-3.5-turbo", # model to send to the proxy\n messages = [\n {\n "role": "user",\n "content": "this is a test request, write a short poem"\n }\n ]\n)\n\nprint(response)\n '})}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"python",children:'\nimport os, dotenv\n\nfrom llama_index.llms import AzureOpenAI\nfrom llama_index.embeddings import AzureOpenAIEmbedding\nfrom llama_index import VectorStoreIndex, SimpleDirectoryReader, ServiceContext\n\nllm = AzureOpenAI(\n engine="azure-gpt-3.5", # model_name on litellm proxy\n temperature=0.0,\n azure_endpoint="http://0.0.0.0:4000", # litellm proxy endpoint\n api_key="sk-1234", # litellm proxy API Key\n api_version="2023-07-01-preview",\n)\n\nembed_model = AzureOpenAIEmbedding(\n deployment_name="azure-embedding-model",\n azure_endpoint="http://0.0.0.0:4000",\n api_key="sk-1234",\n api_version="2023-07-01-preview",\n)\n\n\ndocuments = SimpleDirectoryReader("llama_index_data").load_data()\nservice_context = ServiceContext.from_defaults(llm=llm, embed_model=embed_model)\nindex = VectorStoreIndex.from_documents(documents, service_context=service_context)\n\nquery_engine = index.as_query_engine()\nresponse = query_engine.query("What did the author do growing up?")\nprint(response)\n\n '})}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"python",children:'\nfrom langchain.chat_models import ChatOpenAI\nfrom langchain.prompts.chat import (\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n SystemMessagePromptTemplate,\n)\nfrom langchain.schema import HumanMessage, SystemMessage\n\nchat = ChatOpenAI(\n openai_api_base="http://0.0.0.0:4000",\n model = "gpt-3.5-turbo",\n temperature=0.1\n)\n\nmessages = [\n SystemMessage(\n content="You are a helpful assistant that im using to make a test request to."\n ),\n HumanMessage(\n content="test from litellm. tell me why it\'s amazing in 1 sentence"\n ),\n]\nresponse = chat(messages)\n\nprint(response)\n\n '})})]})]})]})})})};async function eQ(e,l,s,t){console.log("isLocal:",!1);let n=window.location.origin,a=new ez.ZP.OpenAI({apiKey:t,baseURL:n,dangerouslyAllowBrowser:!0});try{for await(let t of(await a.chat.completions.create({model:s,stream:!0,messages:[{role:"user",content:e}]})))console.log(t),t.choices[0].delta.content&&l(t.choices[0].delta.content)}catch(e){k.ZP.error("Error occurred while generating model response. Please try again. Error: ".concat(e),20)}}var e0=e=>{let{accessToken:l,token:s,userRole:t,userID:n}=e,[i,o]=(0,r.useState)(""),[d,c]=(0,r.useState)(""),[m,g]=(0,r.useState)([]),[Z,f]=(0,r.useState)(void 0),[y,b]=(0,r.useState)([]);(0,r.useEffect)(()=>{l&&s&&t&&n&&(async()=>{try{let e=await (0,u.So)(l,n,t);if(console.log("model_info:",e),(null==e?void 0:e.data.length)>0){let l=e.data.map(e=>({value:e.id,label:e.id}));console.log(l),b(l),f(e.data[0].id)}}catch(e){console.error("Error fetching model info:",e)}})()},[l,n,t]);let S=(e,l)=>{g(s=>{let t=s[s.length-1];return t&&t.role===e?[...s.slice(0,s.length-1),{role:e,content:t.content+l}]:[...s,{role:e,content:l}]})},k=async()=>{if(""!==d.trim()&&i&&s&&t&&n){g(e=>[...e,{role:"user",content:d}]);try{Z&&await eQ(d,e=>S("assistant",e),Z,i)}catch(e){console.error("Error fetching model response",e),S("assistant","Error fetching model response")}c("")}};if(t&&"Admin Viewer"==t){let{Title:e,Paragraph:l}=ee.default;return(0,a.jsxs)("div",{children:[(0,a.jsx)(e,{level:1,children:"Access Denied"}),(0,a.jsx)(l,{children:"Ask your proxy admin for access to test models"})]})}return(0,a.jsx)("div",{style:{width:"100%",position:"relative"},children:(0,a.jsx)(x.Z,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,a.jsx)(F.Z,{children:(0,a.jsxs)(en.Z,{children:[(0,a.jsx)(ea.Z,{children:(0,a.jsx)(et.Z,{children:"Chat"})}),(0,a.jsx)(ei.Z,{children:(0,a.jsxs)(er.Z,{children:[(0,a.jsx)("div",{className:"sm:max-w-2xl",children:(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(_.Z,{children:"API Key"}),(0,a.jsx)(j.Z,{placeholder:"Type API Key here",type:"password",onValueChange:o,value:i})]}),(0,a.jsxs)(h.Z,{className:"mx-2",children:[(0,a.jsx)(_.Z,{children:"Select Model:"}),(0,a.jsx)(v.default,{placeholder:"Select a Model",onChange:e=>{console.log("selected ".concat(e)),f(e)},options:y,style:{width:"200px"}})]})]})}),(0,a.jsxs)(L.Z,{className:"mt-5",style:{display:"block",maxHeight:"60vh",overflowY:"auto"},children:[(0,a.jsx)(K.Z,{children:(0,a.jsx)(q.Z,{children:(0,a.jsx)(D.Z,{})})}),(0,a.jsx)(U.Z,{children:m.map((e,l)=>(0,a.jsx)(q.Z,{children:(0,a.jsx)(D.Z,{children:"".concat(e.role,": ").concat(e.content)})},l))})]}),(0,a.jsx)("div",{className:"mt-3",style:{position:"absolute",bottom:5,width:"95%"},children:(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)(j.Z,{type:"text",value:d,onChange:e=>c(e.target.value),placeholder:"Type your message..."}),(0,a.jsx)(p.Z,{onClick:k,className:"ml-2",children:"Send"})]})})]})})]})})})})},e1=s(33509),e2=s(95781);let{Sider:e4}=e1.default;var e5=e=>{let{setPage:l,userRole:s,defaultSelectedKey:t}=e;return"Admin Viewer"==s?(0,a.jsx)(e1.default,{style:{minHeight:"100vh",maxWidth:"120px"},children:(0,a.jsx)(e4,{width:120,children:(0,a.jsxs)(e2.Z,{mode:"inline",defaultSelectedKeys:t||["4"],style:{height:"100%",borderRight:0},children:[(0,a.jsx)(e2.Z.Item,{onClick:()=>l("api-keys"),children:"API Keys"},"4"),(0,a.jsx)(e2.Z.Item,{onClick:()=>l("models"),children:"Models"},"2"),(0,a.jsx)(e2.Z.Item,{onClick:()=>l("llm-playground"),children:"Chat UI"},"3"),(0,a.jsx)(e2.Z.Item,{onClick:()=>l("usage"),children:"Usage"},"1")]})})}):(0,a.jsx)(e1.default,{style:{minHeight:"100vh",maxWidth:"145px"},children:(0,a.jsx)(e4,{width:145,children:(0,a.jsxs)(e2.Z,{mode:"inline",defaultSelectedKeys:t||["1"],style:{height:"100%",borderRight:0},children:[(0,a.jsx)(e2.Z.Item,{onClick:()=>l("api-keys"),children:(0,a.jsx)(_.Z,{children:"API Keys"})},"1"),(0,a.jsx)(e2.Z.Item,{onClick:()=>l("llm-playground"),children:(0,a.jsx)(_.Z,{children:"Test Key"})},"3"),"Admin"==s?(0,a.jsx)(e2.Z.Item,{onClick:()=>l("models"),children:(0,a.jsx)(_.Z,{children:"Models"})},"2"):null,"Admin"==s?(0,a.jsx)(e2.Z.Item,{onClick:()=>l("usage"),children:(0,a.jsx)(_.Z,{children:"Usage"})},"4"):null,"Admin"==s?(0,a.jsx)(e2.Z.Item,{onClick:()=>l("teams"),children:(0,a.jsx)(_.Z,{children:"Teams"})},"6"):null,"Admin"==s?(0,a.jsx)(e2.Z.Item,{onClick:()=>l("users"),children:(0,a.jsx)(_.Z,{children:"Users"})},"5"):null,"Admin"==s?(0,a.jsx)(e2.Z.Item,{onClick:()=>l("settings"),children:(0,a.jsx)(_.Z,{children:"Logging & Alerts"})},"8"):null,"Admin"==s?(0,a.jsx)(e2.Z.Item,{onClick:()=>l("budgets"),children:(0,a.jsx)(_.Z,{children:"Rate Limits"})},"9"):null,"Admin"==s?(0,a.jsx)(e2.Z.Item,{onClick:()=>l("general-settings"),children:(0,a.jsx)(_.Z,{children:"Router Settings"})},"10"):null,"Admin"==s?(0,a.jsx)(e2.Z.Item,{onClick:()=>l("admin-panel"),children:(0,a.jsx)(_.Z,{children:"Admin"})},"11"):null,(0,a.jsx)(e2.Z.Item,{onClick:()=>l("api_ref"),children:(0,a.jsx)(_.Z,{children:"API Reference"})},"12"),(0,a.jsx)(e2.Z.Item,{onClick:()=>l("model-hub"),children:(0,a.jsx)(_.Z,{children:"Model Hub"})},"14")]})})})},e8=s(67989),e3=s(49167),e6=s(52703),e7=e=>{let{accessToken:l,token:s,userRole:t,userID:n,keys:i,premiumUser:o}=e,d=new Date,[c,m]=(0,r.useState)([]),[j,g]=(0,r.useState)([]),[Z,f]=(0,r.useState)([]),[b,v]=(0,r.useState)([]),[S,k]=(0,r.useState)([]),[w,N]=(0,r.useState)([]),[A,I]=(0,r.useState)([]),[C,E]=(0,r.useState)([]),[P,T]=(0,r.useState)([]),[O,R]=(0,r.useState)({}),[M,G]=(0,r.useState)([]),[W,H]=(0,r.useState)(""),[Y,$]=(0,r.useState)({from:new Date(Date.now()-6048e5),to:new Date}),X=new Date(d.getFullYear(),d.getMonth(),1),Q=new Date(d.getFullYear(),d.getMonth()+1,0),ee=eu(X),el=eu(Q);console.log("keys in usage",i),console.log("premium user in usage",o);let eo=async(e,s,t)=>{if(!e||!s||!l)return;s.setHours(23,59,59,999),e.setHours(0,0,0,0),console.log("uiSelectedKey",t);let n=await (0,u.b1)(l,t,e.toISOString(),s.toISOString());console.log("End user data updated successfully",n),v(n)},ed=async(e,s)=>{e&&s&&l&&(s.setHours(23,59,59,999),e.setHours(0,0,0,0),N((await (0,u.J$)(l,e.toISOString(),s.toISOString())).spend_per_tag),console.log("Tag spend data updated successfully"))};function eu(e){let l=e.getFullYear(),s=e.getMonth()+1,t=e.getDate();return"".concat(l,"-").concat(s<10?"0"+s:s,"-").concat(t<10?"0"+t:t)}return console.log("Start date is ".concat(ee)),console.log("End date is ".concat(el)),(0,r.useEffect)(()=>{l&&s&&t&&n&&(async()=>{try{if(console.log("user role: ".concat(t)),"Admin"==t||"Admin Viewer"==t){var e,a;let t=await (0,u.FC)(l);m(t);let n=await (0,u.OU)(l,s,ee,el);console.log("provider_spend",n),T(n);let r=(await (0,u.tN)(l)).map(e=>({key:(e.key_alias||e.key_name||e.api_key).substring(0,10),spend:e.total_spend}));g(r);let i=(await (0,u.Au)(l)).map(e=>({key:e.model,spend:e.total_spend}));f(i);let o=await (0,u.mR)(l);console.log("teamSpend",o),k(o.daily_spend),I(o.teams);let d=o.total_spend_per_team;d=d.map(e=>(e.name=e.team_id||"",e.value=e.total_spend||0,e.value=e.value.toFixed(2),e)),E(d);let c=await (0,u.J$)(l,null===(e=Y.from)||void 0===e?void 0:e.toISOString(),null===(a=Y.to)||void 0===a?void 0:a.toISOString());N(c.spend_per_tag);let h=await (0,u.b1)(l,null,void 0,void 0);v(h),console.log("spend/user result",h);let x=await (0,u.wd)(l,ee,el);R(x);let p=await (0,u.xA)(l,ee,el);console.log("global activity per model",p),G(p)}else"App Owner"==t&&await (0,u.HK)(l,s,t,n,ee,el).then(async e=>{if(console.log("result from spend logs call",e),"daily_spend"in e){let l=e.daily_spend;console.log("daily spend",l),m(l);let s=e.top_api_keys;g(s)}else{let s=(await (0,u.e2)(l,function(e){let l=[];e.forEach(e=>{Object.entries(e).forEach(e=>{let[s,t]=e;"spend"!==s&&"startTime"!==s&&"models"!==s&&"users"!==s&&l.push({key:s,spend:t})})}),l.sort((e,l)=>Number(l.spend)-Number(e.spend));let s=l.slice(0,5).map(e=>e.key);return console.log("topKeys: ".concat(Object.keys(s[0]))),s}(e))).info.map(e=>({key:(e.key_name||e.key_alias).substring(0,10),spend:e.spend}));g(s),m(e)}})}catch(e){console.error("There was an error fetching the data",e)}})()},[l,s,t,n,ee,el]),(0,a.jsxs)("div",{style:{width:"100%"},className:"p-8",children:[(0,a.jsx)(J,{userID:n,userRole:t,accessToken:l,userSpend:null,selectedTeam:null}),(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{className:"mt-2",children:[(0,a.jsx)(et.Z,{children:"All Up"}),(0,a.jsx)(et.Z,{children:"Team Based Usage"}),(0,a.jsx)(et.Z,{children:"End User Usage"}),(0,a.jsx)(et.Z,{children:"Tag Based Usage"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{variant:"solid",className:"mt-1",children:[(0,a.jsx)(et.Z,{children:"Cost"}),(0,a.jsx)(et.Z,{children:"Activity"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsxs)(x.Z,{numItems:2,className:"gap-2 h-[100vh] w-full",children:[(0,a.jsx)(h.Z,{numColSpan:2,children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Monthly Spend"}),(0,a.jsx)(em.Z,{data:c,index:"date",categories:["spend"],colors:["blue"],valueFormatter:e=>"$ ".concat(new Intl.NumberFormat("us").format(e).toString()),yAxisWidth:100,tickGap:5})]})}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Top API Keys"}),(0,a.jsx)(em.Z,{className:"mt-4 h-40",data:j,index:"key",categories:["spend"],colors:["blue"],yAxisWidth:80,tickGap:5,layout:"vertical",showXAxis:!1,showLegend:!1})]})}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Top Models"}),(0,a.jsx)(em.Z,{className:"mt-4 h-40",data:Z,index:"key",categories:["spend"],colors:["blue"],yAxisWidth:200,layout:"vertical",showXAxis:!1,showLegend:!1})]})}),(0,a.jsx)(h.Z,{numColSpan:1}),(0,a.jsx)(h.Z,{numColSpan:2,children:(0,a.jsxs)(F.Z,{className:"mb-2",children:[(0,a.jsx)(y.Z,{children:"✨ Spend by Provider"}),o?(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsx)(e6.Z,{className:"mt-4 h-40",variant:"pie",data:P,index:"provider",category:"spend"})}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Provider"}),(0,a.jsx)(B.Z,{children:"Spend"})]})}),(0,a.jsx)(U.Z,{children:P.map(e=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.provider}),(0,a.jsx)(D.Z,{children:1e-5>parseFloat(e.spend.toFixed(2))?"less than 0.00":e.spend.toFixed(2)})]},e.provider))})]})})]})}):(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to use this feature"}),(0,a.jsx)(p.Z,{variant:"primary",className:"mb-2",children:(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})})]})]})})]})}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 h-[75vh] w-full",children:[(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"All Up"}),(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e3.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",O.sum_api_requests]}),(0,a.jsx)(ec.Z,{className:"h-40",data:O.daily_data,index:"date",colors:["cyan"],categories:["api_requests"],onValueChange:e=>console.log(e)})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e3.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",O.sum_total_tokens]}),(0,a.jsx)(em.Z,{className:"h-40",data:O.daily_data,index:"date",colors:["cyan"],categories:["total_tokens"],onValueChange:e=>console.log(e)})]})]})]}),o?(0,a.jsx)(a.Fragment,{children:M.map((e,l)=>(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:e.model}),(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e3.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",e.sum_api_requests]}),(0,a.jsx)(ec.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["api_requests"],onValueChange:e=>console.log(e)})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e3.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",e.sum_total_tokens]}),(0,a.jsx)(em.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["total_tokens"],onValueChange:e=>console.log(e)})]})]})]},l))}):(0,a.jsx)(a.Fragment,{children:M&&M.length>0&&M.slice(0,1).map((e,l)=>(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"✨ Activity by Model"}),(0,a.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to see analytics for all models"}),(0,a.jsx)(p.Z,{variant:"primary",className:"mb-2",children:(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:e.model}),(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e3.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",e.sum_api_requests]}),(0,a.jsx)(ec.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["api_requests"],onValueChange:e=>console.log(e)})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e3.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",e.sum_total_tokens]}),(0,a.jsx)(em.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["total_tokens"],onValueChange:e=>console.log(e)})]})]})]})]},l))})]})})]})]})}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(x.Z,{numItems:2,className:"gap-2 h-[75vh] w-full",children:[(0,a.jsxs)(h.Z,{numColSpan:2,children:[(0,a.jsxs)(F.Z,{className:"mb-2",children:[(0,a.jsx)(y.Z,{children:"Total Spend Per Team"}),(0,a.jsx)(e8.Z,{data:C})]}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Daily Spend Per Team"}),(0,a.jsx)(em.Z,{className:"h-72",data:S,showLegend:!0,index:"date",categories:A,yAxisWidth:80,colors:["blue","green","yellow","red","purple"],stack:!0})]})]}),(0,a.jsx)(h.Z,{numColSpan:2})]})}),(0,a.jsxs)(er.Z,{children:[(0,a.jsxs)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:["End-Users of your LLM API calls. Tracked when a `user` param is passed in your LLM calls ",(0,a.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/users",target:"_blank",children:"docs here"})]}),(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(_.Z,{children:"Select Time Range"}),(0,a.jsx)(es.Z,{enableSelect:!0,value:Y,onValueChange:e=>{$(e),eo(e.from,e.to,null)}})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(_.Z,{children:"Select Key"}),(0,a.jsxs)(z.Z,{defaultValue:"all-keys",children:[(0,a.jsx)(V.Z,{value:"all-keys",onClick:()=>{eo(Y.from,Y.to,null)},children:"All Keys"},"all-keys"),null==i?void 0:i.map((e,l)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,a.jsx)(V.Z,{value:String(l),onClick:()=>{eo(Y.from,Y.to,e.token)},children:e.key_alias},l):null)]})]})]}),(0,a.jsx)(F.Z,{className:"mt-4",children:(0,a.jsxs)(L.Z,{className:"max-h-[70vh] min-h-[500px]",children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"End User"}),(0,a.jsx)(B.Z,{children:"Spend"}),(0,a.jsx)(B.Z,{children:"Total Events"})]})}),(0,a.jsx)(U.Z,{children:null==b?void 0:b.map((e,l)=>{var s;return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.end_user}),(0,a.jsx)(D.Z,{children:null===(s=e.total_spend)||void 0===s?void 0:s.toFixed(4)}),(0,a.jsx)(D.Z,{children:e.total_count})]},l)})})]})})]}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(x.Z,{numItems:2,className:"gap-2 h-[75vh] w-full mb-4",children:[(0,a.jsxs)(h.Z,{numColSpan:2,children:[(0,a.jsx)(es.Z,{className:"mb-4",enableSelect:!0,value:Y,onValueChange:e=>{$(e),ed(e.from,e.to)}}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Spend Per Tag"}),(0,a.jsxs)(_.Z,{children:["Get Started Tracking cost per tag ",(0,a.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/enterprise#tracking-spend-for-custom-tags",target:"_blank",children:"here"})]}),(0,a.jsx)(em.Z,{className:"h-72",data:w,index:"name",categories:["spend"],colors:["blue"]})]})]}),(0,a.jsx)(h.Z,{numColSpan:2})]})})]})]})]})},e9=()=>{let{Title:e,Paragraph:l}=ee.default,[s,t]=(0,r.useState)(""),[n,o]=(0,r.useState)(!1),[d,c]=(0,r.useState)(null),[u,h]=(0,r.useState)(null),[x,p]=(0,r.useState)(null),[j,g]=(0,r.useState)(!0),Z=(0,i.useSearchParams)(),[f,_]=(0,r.useState)({data:[]}),y=Z.get("userID"),b=Z.get("token"),[v,S]=(0,r.useState)("api-keys"),[k,w]=(0,r.useState)(null);return(0,r.useEffect)(()=>{if(b){let e=(0,Q.o)(b);if(e){if(console.log("Decoded token:",e),console.log("Decoded key:",e.key),w(e.key),e.user_role){let l=function(e){if(!e)return"Undefined Role";switch(console.log("Received user role: ".concat(e.toLowerCase())),console.log("Received user role length: ".concat(e.toLowerCase().length)),e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(e.user_role);console.log("Decoded user_role:",l),t(l),"Admin Viewer"==l&&S("usage")}else console.log("User role not defined");e.user_email?c(e.user_email):console.log("User Email is not set ".concat(e)),e.login_method?g("username_password"==e.login_method):console.log("User Email is not set ".concat(e)),e.premium_user&&o(e.premium_user)}}},[b]),(0,a.jsx)(r.Suspense,{fallback:(0,a.jsx)("div",{children:"Loading..."}),children:(0,a.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,a.jsx)(m,{userID:y,userRole:s,userEmail:d,showSSOBanner:j,premiumUser:n}),(0,a.jsxs)("div",{className:"flex flex-1 overflow-auto",children:[(0,a.jsx)("div",{className:"mt-8",children:(0,a.jsx)(e5,{setPage:S,userRole:s,defaultSelectedKey:null})}),"api-keys"==v?(0,a.jsx)(el,{userID:y,userRole:s,teams:u,keys:x,setUserRole:t,userEmail:d,setUserEmail:c,setTeams:h,setKeys:p}):"models"==v?(0,a.jsx)(eC,{userID:y,userRole:s,token:b,accessToken:k,modelData:f,setModelData:_,premiumUser:n}):"llm-playground"==v?(0,a.jsx)(e0,{userID:y,userRole:s,token:b,accessToken:k}):"users"==v?(0,a.jsx)(eT,{userID:y,userRole:s,token:b,keys:x,teams:u,accessToken:k,setKeys:p}):"teams"==v?(0,a.jsx)(eO,{teams:u,setTeams:h,searchParams:Z,accessToken:k,userID:y,userRole:s}):"admin-panel"==v?(0,a.jsx)(eR,{setTeams:h,searchParams:Z,accessToken:k,showSSOBanner:j}):"api_ref"==v?(0,a.jsx)(eX,{}):"settings"==v?(0,a.jsx)(eK,{userID:y,userRole:s,accessToken:k,premiumUser:n}):"budgets"==v?(0,a.jsx)(eJ,{accessToken:k}):"general-settings"==v?(0,a.jsx)(eH,{userID:y,userRole:s,accessToken:k,modelData:f}):"model-hub"==v?(0,a.jsx)(e$.Z,{accessToken:k,publicPage:!1,premiumUser:n}):(0,a.jsx)(e7,{userID:y,userRole:s,token:b,accessToken:k,keys:x,premiumUser:n})]})]})})}}},function(e){e.O(0,[936,359,440,134,971,69,744],function(){return e(e.s=20661)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/chunks/app/page-1fb033a77b428a50.js b/ui/litellm-dashboard/out/_next/static/chunks/app/page-1fb033a77b428a50.js new file mode 100644 index 0000000000..82b275b531 --- /dev/null +++ b/ui/litellm-dashboard/out/_next/static/chunks/app/page-1fb033a77b428a50.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{20661:function(e,l,s){Promise.resolve().then(s.bind(s,5347))},5347:function(e,l,s){"use strict";s.r(l),s.d(l,{default:function(){return le}});var t,n,a=s(3827),r=s(64090),i=s(47907),o=s(8792),d=s(40491),c=s(65270),m=e=>{let{userID:l,userRole:s,userEmail:t,showSSOBanner:n,premiumUser:r}=e;console.log("User ID:",l),console.log("userEmail:",t),console.log("showSSOBanner:",n),console.log("premiumUser:",r);let i=[{key:"1",label:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("p",{children:["Role: ",s]}),(0,a.jsxs)("p",{children:["ID: ",l]}),(0,a.jsxs)("p",{children:["Premium User: ",String(r)]})]})},{key:"2",label:(0,a.jsx)(o.default,{href:"/",children:(0,a.jsx)("p",{children:"Logout"})})}];return(0,a.jsxs)("nav",{className:"left-0 right-0 top-0 flex justify-between items-center h-12 mb-4",children:[(0,a.jsx)("div",{className:"text-left my-2 absolute top-0 left-0",children:(0,a.jsx)("div",{className:"flex flex-col items-center",children:(0,a.jsx)(o.default,{href:"/",children:(0,a.jsx)("button",{className:"text-gray-800 rounded text-center",children:(0,a.jsx)("img",{src:"/get_image",width:160,height:160,alt:"LiteLLM Brand",className:"mr-2"})})})})}),(0,a.jsxs)("div",{className:"text-right mx-4 my-2 absolute top-0 right-0 flex items-center justify-end space-x-2",children:[n?(0,a.jsx)("div",{style:{padding:"6px",borderRadius:"8px"},children:(0,a.jsx)("a",{href:"https://calendly.com/d/4mp-gd3-k5k/litellm-1-1-onboarding-chat",target:"_blank",style:{fontSize:"14px",textDecoration:"underline"},children:"Get enterpise license"})}):null,(0,a.jsx)("div",{style:{border:"1px solid #391085",padding:"6px",borderRadius:"8px"},children:(0,a.jsx)(d.Z,{menu:{items:i},children:(0,a.jsx)(c.Z,{children:t})})})]})]})},u=s(777),h=s(10384),x=s(46453),p=s(16450),j=s(52273),g=s(26780),Z=s(15595),f=s(6698),_=s(71801),y=s(42440),b=s(42308),v=s(50670),S=s(81583),k=s(80588),w=s(99129),N=s(44839),A=s(88707),I=s(1861);let{Option:E}=v.default;var C=e=>{let{userID:l,team:s,userRole:t,accessToken:n,data:i,setData:o}=e,[d]=S.Z.useForm(),[c,m]=(0,r.useState)(!1),[C,P]=(0,r.useState)(null),[T,O]=(0,r.useState)(null),[R,F]=(0,r.useState)([]),[M,L]=(0,r.useState)([]),U=()=>{m(!1),d.resetFields()},D=()=>{m(!1),P(null),d.resetFields()};(0,r.useEffect)(()=>{(async()=>{try{if(null===l||null===t)return;if(null!==n){let e=(await (0,u.So)(n,l,t)).data.map(e=>e.id);console.log("available_model_names:",e),F(e)}}catch(e){console.error("Error fetching user models:",e)}})()},[n,l,t]);let K=async e=>{try{var s,t,a;let r=null!==(s=null==e?void 0:e.key_alias)&&void 0!==s?s:"",c=null!==(t=null==e?void 0:e.team_id)&&void 0!==t?t:null;if((null!==(a=null==i?void 0:i.filter(e=>e.team_id===c).map(e=>e.key_alias))&&void 0!==a?a:[]).includes(r))throw Error("Key alias ".concat(r," already exists for team with ID ").concat(c,", please provide another key alias"));k.ZP.info("Making API Call"),m(!0);let h=await (0,u.wX)(n,l,e);console.log("key create Response:",h),o(e=>e?[...e,h]:[h]),P(h.key),O(h.soft_budget),k.ZP.success("API Key Created"),d.resetFields(),localStorage.removeItem("userData"+l)}catch(e){console.error("Error creating the key:",e),k.ZP.error("Error creating the key: ".concat(e),20)}};return(0,r.useEffect)(()=>{L(s&&s.models.length>0?s.models.includes("all-proxy-models")?R:s.models:R)},[s,R]),(0,a.jsxs)("div",{children:[(0,a.jsx)(p.Z,{className:"mx-auto",onClick:()=>m(!0),children:"+ Create New Key"}),(0,a.jsx)(w.Z,{title:"Create Key",visible:c,width:800,footer:null,onOk:U,onCancel:D,children:(0,a.jsxs)(S.Z,{form:d,onFinish:K,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Key Name",name:"key_alias",rules:[{required:!0,message:"Please input a key name"}],help:"required",children:(0,a.jsx)(j.Z,{placeholder:""})}),(0,a.jsx)(S.Z.Item,{label:"Team ID",name:"team_id",hidden:!0,initialValue:s?s.team_id:null,valuePropName:"team_id",className:"mt-8",children:(0,a.jsx)(N.Z,{value:s?s.team_alias:"",disabled:!0})}),(0,a.jsx)(S.Z.Item,{label:"Models",name:"models",rules:[{required:!0,message:"Please select a model"}],help:"required",children:(0,a.jsxs)(v.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},onChange:e=>{e.includes("all-team-models")&&d.setFieldsValue({models:["all-team-models"]})},children:[(0,a.jsx)(E,{value:"all-team-models",children:"All Team Models"},"all-team-models"),M.map(e=>(0,a.jsx)(E,{value:e,children:e},e))]})}),(0,a.jsxs)(g.Z,{className:"mt-20 mb-8",children:[(0,a.jsx)(f.Z,{children:(0,a.jsx)("b",{children:"Optional Settings"})}),(0,a.jsxs)(Z.Z,{children:[(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Max Budget (USD)",name:"max_budget",help:"Budget cannot exceed team max budget: $".concat((null==s?void 0:s.max_budget)!==null&&(null==s?void 0:s.max_budget)!==void 0?null==s?void 0:s.max_budget:"unlimited"),rules:[{validator:async(e,l)=>{if(l&&s&&null!==s.max_budget&&l>s.max_budget)throw Error("Budget cannot exceed team max budget: $".concat(s.max_budget))}}],children:(0,a.jsx)(A.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",help:"Team Reset Budget: ".concat((null==s?void 0:s.budget_duration)!==null&&(null==s?void 0:s.budget_duration)!==void 0?null==s?void 0:s.budget_duration:"None"),children:(0,a.jsxs)(v.default,{defaultValue:null,placeholder:"n/a",children:[(0,a.jsx)(v.default.Option,{value:"24h",children:"daily"}),(0,a.jsx)(v.default.Option,{value:"30d",children:"monthly"})]})}),(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Tokens per minute Limit (TPM)",name:"tpm_limit",help:"TPM cannot exceed team TPM limit: ".concat((null==s?void 0:s.tpm_limit)!==null&&(null==s?void 0:s.tpm_limit)!==void 0?null==s?void 0:s.tpm_limit:"unlimited"),rules:[{validator:async(e,l)=>{if(l&&s&&null!==s.tpm_limit&&l>s.tpm_limit)throw Error("TPM limit cannot exceed team TPM limit: ".concat(s.tpm_limit))}}],children:(0,a.jsx)(A.Z,{step:1,width:400})}),(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Requests per minute Limit (RPM)",name:"rpm_limit",help:"RPM cannot exceed team RPM limit: ".concat((null==s?void 0:s.rpm_limit)!==null&&(null==s?void 0:s.rpm_limit)!==void 0?null==s?void 0:s.rpm_limit:"unlimited"),rules:[{validator:async(e,l)=>{if(l&&s&&null!==s.rpm_limit&&l>s.rpm_limit)throw Error("RPM limit cannot exceed team RPM limit: ".concat(s.rpm_limit))}}],children:(0,a.jsx)(A.Z,{step:1,width:400})}),(0,a.jsx)(S.Z.Item,{label:"Expire Key (eg: 30s, 30h, 30d)",name:"duration",className:"mt-8",children:(0,a.jsx)(j.Z,{placeholder:""})}),(0,a.jsx)(S.Z.Item,{label:"Metadata",name:"metadata",className:"mt-8",children:(0,a.jsx)(N.Z.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})})]})]})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Create Key"})})]})}),C&&(0,a.jsx)(w.Z,{visible:c,onOk:U,onCancel:D,footer:null,children:(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 w-full",children:[(0,a.jsx)(y.Z,{children:"Save your Key"}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)("p",{children:["Please save this secret key somewhere safe and accessible. For security reasons, ",(0,a.jsx)("b",{children:"you will not be able to view it again"})," ","through your LiteLLM account. If you lose this secret key, you will need to generate a new one."]})}),(0,a.jsx)(h.Z,{numColSpan:1,children:null!=C?(0,a.jsxs)("div",{children:[(0,a.jsx)(_.Z,{className:"mt-3",children:"API Key:"}),(0,a.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,a.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:C})}),(0,a.jsx)(b.CopyToClipboard,{text:C,onCopy:()=>{k.ZP.success("API Key copied to clipboard")},children:(0,a.jsx)(p.Z,{className:"mt-3",children:"Copy API Key"})})]}):(0,a.jsx)(_.Z,{children:"Key being created, this might take 30s"})})]})})]})},P=s(9454),T=s(98941),O=s(33393),R=s(5),F=s(13810),M=s(61244),L=s(10827),U=s(3851),D=s(2044),K=s(64167),B=s(74480),q=s(7178),z=s(95093),V=s(27166);let{Option:G}=v.default;var W=e=>{let{userID:l,userRole:s,accessToken:t,selectedTeam:n,data:i,setData:o,teams:d}=e,[c,m]=(0,r.useState)(!1),[h,x]=(0,r.useState)(!1),[j,g]=(0,r.useState)(null),[Z,f]=(0,r.useState)(null),[b,E]=(0,r.useState)(null),[C,W]=(0,r.useState)(""),[H,Y]=(0,r.useState)(!1),[J,$]=(0,r.useState)(!1),[X,Q]=(0,r.useState)(null),[ee,el]=(0,r.useState)([]),es=new Set,[et,en]=(0,r.useState)(es);(0,r.useEffect)(()=>{(async()=>{try{if(null===l)return;if(null!==t&&null!==s){let e=(await (0,u.So)(t,l,s)).data.map(e=>e.id);console.log("available_model_names:",e),el(e)}}catch(e){console.error("Error fetching user models:",e)}})()},[t,l,s]),(0,r.useEffect)(()=>{if(d){let e=new Set;d.forEach((l,s)=>{let t=l.team_id;e.add(t)}),en(e)}},[d]);let ea=e=>{console.log("handleEditClick:",e),null==e.token&&null!==e.token_id&&(e.token=e.token_id),Q(e),Y(!0)},er=async e=>{if(null==t)return;let l=e.token;e.key=l,console.log("handleEditSubmit:",e);let s=await (0,u.Nc)(t,e);console.log("handleEditSubmit: newKeyValues",s),i&&o(i.map(e=>e.token===l?s:e)),k.ZP.success("Key updated successfully"),Y(!1),Q(null)},ei=async e=>{console.log("handleDelete:",e),null==e.token&&null!==e.token_id&&(e.token=e.token_id),null!=i&&(g(e.token),localStorage.removeItem("userData"+l),x(!0))},eo=async()=>{if(null!=j&&null!=i){try{await (0,u.I1)(t,j);let e=i.filter(e=>e.token!==j);o(e)}catch(e){console.error("Error deleting the key:",e)}x(!1),g(null)}};if(null!=i)return console.log("RERENDER TRIGGERED"),(0,a.jsxs)("div",{children:[(0,a.jsxs)(F.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh] mb-4 mt-2",children:[(0,a.jsxs)(L.Z,{className:"mt-5 max-h-[300px] min-h-[300px]",children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Key Alias"}),(0,a.jsx)(B.Z,{children:"Secret Key"}),(0,a.jsx)(B.Z,{children:"Spend (USD)"}),(0,a.jsx)(B.Z,{children:"Budget (USD)"}),(0,a.jsx)(B.Z,{children:"Models"}),(0,a.jsx)(B.Z,{children:"TPM / RPM Limits"})]})}),(0,a.jsx)(U.Z,{children:i.map(e=>{if(console.log(e),"litellm-dashboard"===e.team_id)return null;if(n){if(console.log("item team id: ".concat(e.team_id,", knownTeamIDs.has(item.team_id): ").concat(et.has(e.team_id),", selectedTeam id: ").concat(n.team_id)),(null!=n.team_id||null===e.team_id||et.has(e.team_id))&&e.team_id!=n.team_id)return null;console.log("item team id: ".concat(e.team_id,", is returned"))}return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{style:{maxWidth:"2px",whiteSpace:"pre-wrap",overflow:"hidden"},children:null!=e.key_alias?(0,a.jsx)(_.Z,{children:e.key_alias}):(0,a.jsx)(_.Z,{children:"Not Set"})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(_.Z,{children:e.key_name})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(_.Z,{children:(()=>{try{return parseFloat(e.spend).toFixed(4)}catch(l){return e.spend}})()})}),(0,a.jsx)(D.Z,{children:null!=e.max_budget?(0,a.jsx)(_.Z,{children:e.max_budget}):(0,a.jsx)(_.Z,{children:"Unlimited"})}),(0,a.jsx)(D.Z,{children:Array.isArray(e.models)?(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:0===e.models.length?(0,a.jsx)(a.Fragment,{children:n&&n.models&&n.models.length>0?n.models.map((e,l)=>"all-proxy-models"===e?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Proxy Models"})},l):"all-team-models"===e?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Team Models"})},l):(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,a.jsx)(_.Z,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},l)):(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,a.jsx)(_.Z,{children:"all-proxy-models"})})}):e.models.map((e,l)=>"all-proxy-models"===e?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Proxy Models"})},l):"all-team-models"===e?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Team Models"})},l):(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,a.jsx)(_.Z,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},l))}):null}),(0,a.jsx)(D.Z,{children:(0,a.jsxs)(_.Z,{children:["TPM: ",e.tpm_limit?e.tpm_limit:"Unlimited"," ",(0,a.jsx)("br",{})," RPM:"," ",e.rpm_limit?e.rpm_limit:"Unlimited"]})}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(M.Z,{onClick:()=>{Q(e),$(!0)},icon:P.Z,size:"sm"}),(0,a.jsx)(w.Z,{open:J,onCancel:()=>{$(!1),Q(null)},footer:null,width:800,children:X&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3 mt-8",children:[(0,a.jsxs)(F.Z,{children:[(0,a.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Spend"}),(0,a.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,a.jsx)("p",{className:"text-tremor font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:(()=>{try{return parseFloat(X.spend).toFixed(4)}catch(e){return X.spend}})()})})]}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Budget"}),(0,a.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,a.jsx)("p",{className:"text-tremor font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:null!=X.max_budget?(0,a.jsx)(a.Fragment,{children:X.max_budget}):(0,a.jsx)(a.Fragment,{children:"Unlimited"})})})]},e.name),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Expires"}),(0,a.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,a.jsx)("p",{className:"text-tremor-default font-small text-tremor-content-strong dark:text-dark-tremor-content-strong",children:null!=X.expires?(0,a.jsx)(a.Fragment,{children:new Date(X.expires).toLocaleString(void 0,{day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})}):(0,a.jsx)(a.Fragment,{children:"Never"})})})]},e.name)]}),(0,a.jsxs)(F.Z,{className:"my-4",children:[(0,a.jsx)(y.Z,{children:"Token Name"}),(0,a.jsx)(_.Z,{className:"my-1",children:X.key_alias?X.key_alias:X.key_name}),(0,a.jsx)(y.Z,{children:"Token ID"}),(0,a.jsx)(_.Z,{className:"my-1 text-[12px]",children:X.token}),(0,a.jsx)(y.Z,{children:"Metadata"}),(0,a.jsx)(_.Z,{className:"my-1",children:(0,a.jsxs)("pre",{children:[JSON.stringify(X.metadata)," "]})})]}),(0,a.jsx)(p.Z,{className:"mx-auto flex items-center",onClick:()=>{$(!1),Q(null)},children:"Close"})]})}),(0,a.jsx)(M.Z,{icon:T.Z,size:"sm",onClick:()=>ea(e)}),(0,a.jsx)(M.Z,{onClick:()=>ei(e),icon:O.Z,size:"sm"})]})]},e.token)})})]}),h&&(0,a.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,a.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,a.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,a.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,a.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,a.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,a.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,a.jsx)("div",{className:"sm:flex sm:items-start",children:(0,a.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,a.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Key"}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this key ?"})})]})})}),(0,a.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,a.jsx)(p.Z,{onClick:eo,color:"red",className:"ml-2",children:"Delete"}),(0,a.jsx)(p.Z,{onClick:()=>{x(!1),g(null)},children:"Cancel"})]})]})]})})]}),X&&(0,a.jsx)(e=>{let{visible:l,onCancel:s,token:t,onSubmit:i}=e,[o]=S.Z.useForm(),[c,m]=(0,r.useState)(n),[u,h]=(0,r.useState)([]),[x,p]=(0,r.useState)(!1);return(0,a.jsx)(w.Z,{title:"Edit Key",visible:l,width:800,footer:null,onOk:()=>{o.validateFields().then(e=>{o.resetFields()}).catch(e=>{console.error("Validation failed:",e)})},onCancel:s,children:(0,a.jsxs)(S.Z,{form:o,onFinish:er,initialValues:t,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Key Name",name:"key_alias",rules:[{required:!0,message:"Please input a key name"}],help:"required",children:(0,a.jsx)(N.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"Models",name:"models",rules:[{validator:(e,l)=>{let s=l.filter(e=>!c.models.includes(e)&&"all-team-models"!==e&&"all-proxy-models"!==e&&!c.models.includes("all-proxy-models"));return(console.log("errorModels: ".concat(s)),s.length>0)?Promise.reject("Some models are not part of the new team's models - ".concat(s,"Team models: ").concat(c.models)):Promise.resolve()}}],children:(0,a.jsxs)(v.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,a.jsx)(G,{value:"all-team-models",children:"All Team Models"},"all-team-models"),c&&c.models?c.models.includes("all-proxy-models")?ee.filter(e=>"all-proxy-models"!==e).map(e=>(0,a.jsx)(G,{value:e,children:e},e)):c.models.map(e=>(0,a.jsx)(G,{value:e,children:e},e)):ee.map(e=>(0,a.jsx)(G,{value:e,children:e},e))]})}),(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Max Budget (USD)",name:"max_budget",help:"Budget cannot exceed team max budget: ".concat((null==c?void 0:c.max_budget)!==null&&(null==c?void 0:c.max_budget)!==void 0?null==c?void 0:c.max_budget:"unlimited"),rules:[{validator:async(e,l)=>{if(l&&c&&null!==c.max_budget&&l>c.max_budget)throw console.log("keyTeam.max_budget: ".concat(c.max_budget)),Error("Budget cannot exceed team max budget: $".concat(c.max_budget))}}],children:(0,a.jsx)(A.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{label:"token",name:"token",hidden:!0}),(0,a.jsx)(S.Z.Item,{label:"Team",name:"team_id",help:"the team this key belongs to",children:(0,a.jsx)(z.Z,{value:t.team_alias,children:null==d?void 0:d.map((e,l)=>(0,a.jsx)(V.Z,{value:e.team_id,onClick:()=>m(e),children:e.team_alias},l))})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Edit Key"})})]})})},{visible:H,onCancel:()=>{Y(!1),Q(null)},token:X,onSubmit:er})]})},H=s(76032),Y=s(35152),J=e=>{let{userID:l,userRole:s,accessToken:t,userSpend:n,selectedTeam:i}=e;console.log("userSpend: ".concat(n));let[o,d]=(0,r.useState)(null!==n?n:0),[c,m]=(0,r.useState)(0),[h,x]=(0,r.useState)([]);(0,r.useEffect)(()=>{let e=async()=>{if(t&&l&&s&&"Admin"===s&&null==n)try{let e=await (0,u.Qy)(t);e&&(e.spend?d(e.spend):d(0),e.max_budget?m(e.max_budget):m(0))}catch(e){console.error("Error fetching global spend data:",e)}};(async()=>{try{if(null===l||null===s)return;if(null!==t){let e=(await (0,u.So)(t,l,s)).data.map(e=>e.id);console.log("available_model_names:",e),x(e)}}catch(e){console.error("Error fetching user models:",e)}})(),e()},[s,t,l]),(0,r.useEffect)(()=>{null!==n&&d(n)},[n]);let p=[];i&&i.models&&(p=i.models),p&&p.includes("all-proxy-models")?(console.log("user models:",h),p=h):p&&p.includes("all-team-models")?p=i.models:p&&0===p.length&&(p=h);let j=void 0!==o?o.toFixed(4):null;return console.log("spend in view user spend: ".concat(o)),(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("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:["$",j]})]}),(0,a.jsx)("div",{className:"ml-auto",children:(0,a.jsxs)(g.Z,{children:[(0,a.jsx)(f.Z,{children:(0,a.jsx)(_.Z,{children:"Team Models"})}),(0,a.jsx)(Z.Z,{className:"absolute right-0 z-10 bg-white p-2 shadow-lg max-w-xs",children:(0,a.jsx)(H.Z,{children:p.map(e=>(0,a.jsx)(Y.Z,{children:(0,a.jsx)(_.Z,{children:e})},e))})})]})})]})},$=e=>{let{userID:l,userRole:s,selectedTeam:t,accessToken:n}=e,[i,o]=(0,r.useState)([]);(0,r.useEffect)(()=>{(async()=>{try{if(null===l||null===s)return;if(null!==n){let e=(await (0,u.So)(n,l,s)).data.map(e=>e.id);console.log("available_model_names:",e),o(e)}}catch(e){console.error("Error fetching user models:",e)}})()},[n,l,s]);let d=[];return t&&t.models&&(d=t.models),d&&d.includes("all-proxy-models")&&(console.log("user models:",i),d=i),(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"mb-5",children:(0,a.jsx)("p",{className:"text-3xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:null==t?void 0:t.team_alias})})})},X=e=>{let l,{teams:s,setSelectedTeam:t,userRole:n}=e,i={models:[],team_id:null,team_alias:"Default Team"},[o,d]=(0,r.useState)(i);return(l="App User"===n?s:s?[...s,i]:[i],"App User"===n)?null:(0,a.jsxs)("div",{className:"mt-5 mb-5",children:[(0,a.jsx)(y.Z,{children:"Select Team"}),(0,a.jsx)(_.Z,{children:"If you belong to multiple teams, this setting controls which team is used by default when creating new API Keys."}),(0,a.jsxs)(_.Z,{className:"mt-3 mb-3",children:[(0,a.jsx)("b",{children:"Default Team:"})," If no team_id is set for a key, it will be grouped under here."]}),l&&l.length>0?(0,a.jsx)(z.Z,{defaultValue:"0",children:l.map((e,l)=>(0,a.jsx)(V.Z,{value:String(l),onClick:()=>t(e),children:e.team_alias},l))}):(0,a.jsxs)(_.Z,{children:["No team created. ",(0,a.jsx)("b",{children:"Defaulting to personal account."})]})]})},Q=s(37963),ee=s(97482);console.log("isLocal:",!1);var el=e=>{let{userID:l,userRole:s,teams:t,keys:n,setUserRole:o,userEmail:d,setUserEmail:c,setTeams:m,setKeys:p}=e,[j,g]=(0,r.useState)(null),Z=(0,i.useSearchParams)();Z.get("viewSpend"),(0,i.useRouter)();let f=Z.get("token"),[_,y]=(0,r.useState)(null),[b,v]=(0,r.useState)(null),[S,k]=(0,r.useState)([]),w={models:[],team_alias:"Default Team",team_id:null},[N,A]=(0,r.useState)(t?t[0]:w);if(window.addEventListener("beforeunload",function(){sessionStorage.clear()}),(0,r.useEffect)(()=>{if(f){let e=(0,Q.o)(f);if(e){if(console.log("Decoded token:",e),console.log("Decoded key:",e.key),y(e.key),e.user_role){let l=function(e){if(!e)return"Undefined Role";switch(console.log("Received user role: ".concat(e)),e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(e.user_role);console.log("Decoded user_role:",l),o(l)}else console.log("User role not defined");e.user_email?c(e.user_email):console.log("User Email is not set ".concat(e))}}if(l&&_&&s&&!n&&!j){let e=sessionStorage.getItem("userModels"+l);e?k(JSON.parse(e)):(async()=>{try{let e=await (0,u.Br)(_,l,s,!1,null,null);if(console.log("received teams in user dashboard: ".concat(Object.keys(e),"; team values: ").concat(Object.entries(e.teams))),"Admin"==s){let e=await (0,u.Qy)(_);g(e),console.log("globalSpend:",e)}else g(e.user_info);p(e.keys),m(e.teams);let t=[...e.teams];t.length>0?(console.log("response['teams']: ".concat(t)),A(t[0])):A(w),sessionStorage.setItem("userData"+l,JSON.stringify(e.keys)),sessionStorage.setItem("userSpendData"+l,JSON.stringify(e.user_info));let n=(await (0,u.So)(_,l,s)).data.map(e=>e.id);console.log("available_model_names:",n),k(n),console.log("userModels:",S),sessionStorage.setItem("userModels"+l,JSON.stringify(n))}catch(e){console.error("There was an error fetching the data",e)}})()}},[l,f,_,n,s]),(0,r.useEffect)(()=>{if(null!==n&&null!=N&&null!==N.team_id){let e=0;for(let l of n)N.hasOwnProperty("team_id")&&null!==l.team_id&&l.team_id===N.team_id&&(e+=l.spend);v(e)}else if(null!==n){let e=0;for(let l of n)e+=l.spend;v(e)}},[N]),null==l||null==f){let e="/sso/key/generate";return console.log("Full URL:",e),window.location.href=e,null}if(null==_)return null;if(null==s&&o("App Owner"),s&&"Admin Viewer"==s){let{Title:e,Paragraph:l}=ee.default;return(0,a.jsxs)("div",{children:[(0,a.jsx)(e,{level:1,children:"Access Denied"}),(0,a.jsx)(l,{children:"Ask your proxy admin for access to create keys"})]})}return console.log("inside user dashboard, selected team",N),(0,a.jsx)("div",{className:"w-full mx-4",children:(0,a.jsx)(x.Z,{numItems:1,className:"gap-2 p-8 h-[75vh] w-full mt-2",children:(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)($,{userID:l,userRole:s,selectedTeam:N||null,accessToken:_}),(0,a.jsx)(J,{userID:l,userRole:s,accessToken:_,userSpend:b,selectedTeam:N||null}),(0,a.jsx)(W,{userID:l,userRole:s,accessToken:_,selectedTeam:N||null,data:n,setData:p,teams:t}),(0,a.jsx)(C,{userID:l,team:N||null,userRole:s,accessToken:_,data:n,setData:p},N?N.team_id:null),(0,a.jsx)(X,{teams:t,setSelectedTeam:A,userRole:s})]})})})},es=s(35087),et=s(92836),en=s(26734),ea=s(41608),er=s(32126),ei=s(23682),eo=s(47047),ed=s(76628),ec=s(25707),em=s(44041),eu=s(1460),eh=s(28683),ex=s(38302),ep=s(78578),ej=s(63954),eg=e=>{let{modelID:l,accessToken:s}=e,[t,n]=(0,r.useState)(!1),i=async()=>{try{k.ZP.info("Making API Call"),n(!0);let e=await (0,u.Og)(s,l);console.log("model delete Response:",e),k.ZP.success("Model ".concat(l," deleted successfully")),n(!1)}catch(e){console.error("Error deleting the model:",e)}};return(0,a.jsxs)("div",{children:[(0,a.jsx)(M.Z,{onClick:()=>n(!0),icon:O.Z,size:"sm"}),(0,a.jsx)(w.Z,{open:t,onOk:i,okType:"danger",onCancel:()=>n(!1),children:(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 w-full",children:[(0,a.jsx)(y.Z,{children:"Delete Model"}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsx)("p",{children:"Are you sure you want to delete this model? This action is irreversible."})}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)("p",{children:["Model ID: ",(0,a.jsx)("b",{children:l})]})})]})})]})},eZ=s(97766),ef=s(46495),e_=s(18190),ey=s(91118),eb=e=>{let{modelMetrics:l,modelMetricsCategories:s,customTooltip:t,premiumUser:n}=e;return n?(0,a.jsx)(ey.Z,{title:"Time to First token (s)",className:"h-72",data:l,index:"date",showLegend:!1,categories:s,colors:["indigo","rose"],connectNulls:!0,customTooltip:t}):(0,a.jsxs)("div",{children:[(0,a.jsx)(e_.Z,{title:"✨ Enterprise Feature",color:"teal",className:"mt-2 mb-4",children:"Enterprise features are available for users with a specific license, please contact LiteLLM to unlock this limitation."}),(0,a.jsx)(p.Z,{variant:"primary",children:(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get in touch"})})]})},ev=e=>{let{fields:l,selectedProvider:s}=e;return 0===l.length?null:(0,a.jsx)(a.Fragment,{children:l.map(e=>(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:e.field_name.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),name:e.field_name,tooltip:e.field_description,className:"mb-2",children:(0,a.jsx)(j.Z,{placeholder:e.field_value,type:"password"})},e.field_name))})},eS=s(67951);let{Title:ek,Link:ew}=ee.default;(t=n||(n={})).OpenAI="OpenAI",t.Azure="Azure",t.Anthropic="Anthropic",t.Google_AI_Studio="Google AI Studio",t.Bedrock="Amazon Bedrock",t.OpenAI_Compatible="OpenAI-Compatible Endpoints (Groq, Together AI, Mistral AI, etc.)",t.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",t.Databricks="Databricks";let eN={OpenAI:"openai",Azure:"azure",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",OpenAI_Compatible:"openai",Vertex_AI:"vertex_ai",Databricks:"databricks"},eA={"BadRequestError (400)":"BadRequestErrorRetries","AuthenticationError (401)":"AuthenticationErrorRetries","TimeoutError (408)":"TimeoutErrorRetries","RateLimitError (429)":"RateLimitErrorRetries","ContentPolicyViolationError (400)":"ContentPolicyViolationErrorRetries","InternalServerError (500)":"InternalServerErrorRetries"},eI=async(e,l,s)=>{try{let t=Array.isArray(e.model)?e.model:[e.model];console.log("received deployments: ".concat(t)),console.log("received type of deployments: ".concat(typeof t)),t.forEach(async s=>{console.log("litellm_model: ".concat(s));let t={},n={};t.model=s;let a="";for(let[l,s]of(console.log("formValues add deployment:",e),Object.entries(e)))if(""!==s){if("model_name"==l)a+=s;else if("custom_llm_provider"==l)continue;else if("model"==l)continue;else if("base_model"===l)n[l]=s;else if("litellm_extra_params"==l){console.log("litellm_extra_params:",s);let e={};if(s&&void 0!=s){try{e=JSON.parse(s)}catch(e){throw k.ZP.error("Failed to parse LiteLLM Extra Params: "+e,10),Error("Failed to parse litellm_extra_params: "+e)}for(let[l,s]of Object.entries(e))t[l]=s}}else t[l]=s}let r={model_name:a,litellm_params:t,model_info:n},i=await (0,u.kK)(l,r);console.log("response for model create call: ".concat(i.data))}),s.resetFields()}catch(e){k.ZP.error("Failed to create model: "+e,10)}};var eE=e=>{var l,s,t;let i,{accessToken:o,token:d,userRole:c,userID:m,modelData:h={data:[]},setModelData:g,premiumUser:Z}=e,[f,b]=(0,r.useState)([]),[v]=S.Z.useForm(),[N,E]=(0,r.useState)(null),[C,O]=(0,r.useState)(""),[G,W]=(0,r.useState)([]),H=Object.values(n).filter(e=>isNaN(Number(e))),[Y,J]=(0,r.useState)([]),[$,X]=(0,r.useState)("OpenAI"),[Q,el]=(0,r.useState)(""),[e_,ey]=(0,r.useState)(!1),[eE,eC]=(0,r.useState)(!1),[eP,eT]=(0,r.useState)(null),[eO,eR]=(0,r.useState)([]),[eF,eM]=(0,r.useState)(null),[eL,eU]=(0,r.useState)([]),[eD,eK]=(0,r.useState)([]),[eB,eq]=(0,r.useState)([]),[ez,eV]=(0,r.useState)([]),[eG,eW]=(0,r.useState)([]),[eH,eY]=(0,r.useState)([]),[eJ,e$]=(0,r.useState)([]),[eX,eQ]=(0,r.useState)([]),[e0,e1]=(0,r.useState)([]),[e2,e4]=(0,r.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[e5,e8]=(0,r.useState)(null),[e3,e6]=(0,r.useState)(0),e7=e=>{eT(e),ey(!0)},e9=e=>{eT(e),eC(!0)},le=async e=>{if(console.log("handleEditSubmit:",e),null==o)return;let l={},s=null;for(let[t,n]of Object.entries(e))"model_id"!==t?l[t]=n:s=n;let t={litellm_params:l,model_info:{id:s}};console.log("handleEditSubmit payload:",t);try{await (0,u.um)(o,t),k.ZP.success("Model updated successfully, restart server to see updates"),ey(!1),eT(null)}catch(e){console.log("Error occurred")}},ll=()=>{O(new Date().toLocaleString())},ls=async()=>{if(!o){console.error("Access token is missing");return}console.log("new modelGroupRetryPolicy:",e5);try{await (0,u.K_)(o,{router_settings:{model_group_retry_policy:e5}}),k.ZP.success("Retry settings saved successfully")}catch(e){console.error("Failed to save retry settings:",e),k.ZP.error("Failed to save retry settings")}};if((0,r.useEffect)(()=>{if(!o||!d||!c||!m)return;let e=async()=>{try{var e,l,s,t,n,a,r,i;let d=await (0,u.hy)(o);J(d);let h=await (0,u.AZ)(o,m,c);console.log("Model data response:",h.data),g(h);let x=new Set;for(let e=0;e0&&(j=p[p.length-1],console.log("_initial_model_group:",j),eM(j)),console.log("selectedModelGroup:",eF);let Z=await (0,u.o6)(o,m,c,j,null===(e=e2.from)||void 0===e?void 0:e.toISOString(),null===(l=e2.to)||void 0===l?void 0:l.toISOString());console.log("Model metrics response:",Z),eK(Z.data),eq(Z.all_api_bases);let f=await (0,u.Rg)(o,j,null===(s=e2.from)||void 0===s?void 0:s.toISOString(),null===(t=e2.to)||void 0===t?void 0:t.toISOString());eV(f.data),eW(f.all_api_bases);let _=await (0,u.N8)(o,m,c,j,null===(n=e2.from)||void 0===n?void 0:n.toISOString(),null===(a=e2.to)||void 0===a?void 0:a.toISOString());console.log("Model exceptions response:",_),eY(_.data),e$(_.exception_types);let y=await (0,u.fP)(o,m,c,j,null===(r=e2.from)||void 0===r?void 0:r.toISOString(),null===(i=e2.to)||void 0===i?void 0:i.toISOString());console.log("slowResponses:",y),e1(y);let b=(await (0,u.BL)(o,m,c)).router_settings;console.log("routerSettingsInfo:",b);let v=b.model_group_retry_policy,S=b.num_retries;console.log("model_group_retry_policy:",v),console.log("default_retries:",S),e8(v),e6(S)}catch(e){console.error("There was an error fetching the model data",e)}};o&&d&&c&&m&&e();let l=async()=>{let e=await (0,u.qm)();console.log("received model cost map data: ".concat(Object.keys(e))),E(e)};null==N&&l(),ll()},[o,d,c,m,N,C]),!h||!o||!d||!c||!m)return(0,a.jsx)("div",{children:"Loading..."});let lt=[];for(let e=0;e(console.log("GET PROVIDER CALLED! - ".concat(N)),null!=N&&"object"==typeof N&&e in N)?N[e].litellm_provider:"openai";if(n){let e=n.split("/"),l=e[0];r=1===e.length?u(n):l}else r="openai";a&&(i=null==a?void 0:a.input_cost_per_token,o=null==a?void 0:a.output_cost_per_token,d=null==a?void 0:a.max_tokens,c=null==a?void 0:a.max_input_tokens),(null==t?void 0:t.litellm_params)&&(m=Object.fromEntries(Object.entries(null==t?void 0:t.litellm_params).filter(e=>{let[l]=e;return"model"!==l&&"api_base"!==l}))),h.data[e].provider=r,h.data[e].input_cost=i,h.data[e].output_cost=o,h.data[e].input_cost&&(h.data[e].input_cost=(1e6*Number(h.data[e].input_cost)).toFixed(2)),h.data[e].output_cost&&(h.data[e].output_cost=(1e6*Number(h.data[e].output_cost)).toFixed(2)),h.data[e].max_tokens=d,h.data[e].max_input_tokens=c,h.data[e].api_base=null==t?void 0:null===(s=t.litellm_params)||void 0===s?void 0:s.api_base,h.data[e].cleanedLitellmParams=m,lt.push(t.model_name),console.log(h.data[e])}if(c&&"Admin Viewer"==c){let{Title:e,Paragraph:l}=ee.default;return(0,a.jsxs)("div",{children:[(0,a.jsx)(e,{level:1,children:"Access Denied"}),(0,a.jsx)(l,{children:"Ask your proxy admin for access to view all models"})]})}let ln=e=>{console.log("received provider string: ".concat(e));let l=Object.keys(n).find(l=>n[l]===e);if(l){let e=eN[l];console.log("mappingResult: ".concat(e));let s=[];"object"==typeof N&&Object.entries(N).forEach(l=>{let[t,n]=l;null!==n&&"object"==typeof n&&"litellm_provider"in n&&(n.litellm_provider===e||n.litellm_provider.includes(e))&&s.push(t)}),W(s),console.log("providerModels: ".concat(G))}},la=async()=>{try{k.ZP.info("Running health check..."),el("");let e=await (0,u.EY)(o);el(e)}catch(e){console.error("Error running health check:",e),el("Error running health check")}},lr=async(e,l,s)=>{if(console.log("Updating model metrics for group:",e),o&&m&&c&&l&&s){console.log("inside updateModelMetrics - startTime:",l,"endTime:",s),eM(e);try{let t=await (0,u.o6)(o,m,c,e,l.toISOString(),s.toISOString());console.log("Model metrics response:",t),eK(t.data),eq(t.all_api_bases);let n=await (0,u.Rg)(o,e,l.toISOString(),s.toISOString());eV(n.data),eW(n.all_api_bases);let a=await (0,u.N8)(o,m,c,e,l.toISOString(),s.toISOString());console.log("Model exceptions response:",a),eY(a.data),e$(a.exception_types);let r=await (0,u.fP)(o,m,c,e,l.toISOString(),s.toISOString());console.log("slowResponses:",r),e1(r)}catch(e){console.error("Failed to fetch model metrics",e)}}},li=e=>{var l,s;let{payload:t,active:n}=e;if(!n||!t)return null;let r=null===(s=t[0])||void 0===s?void 0:null===(l=s.payload)||void 0===l?void 0:l.date,i=t.sort((e,l)=>l.value-e.value);if(i.length>5){let e=i.length-5;(i=i.slice(0,5)).push({dataKey:"".concat(e," other deployments"),value:t.slice(5).reduce((e,l)=>e+l.value,0),color:"gray"})}return(0,a.jsxs)("div",{className:"w-150 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown",children:[r&&(0,a.jsxs)("p",{className:"text-tremor-content-emphasis mb-2",children:["Date: ",r]}),i.map((e,l)=>{let s=parseFloat(e.value.toFixed(5)),t=0===s&&e.value>0?"<0.00001":s.toFixed(5);return(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("div",{className:"w-2 h-2 mt-1 rounded-full bg-".concat(e.color,"-500")}),(0,a.jsx)("p",{className:"text-tremor-content",children:e.dataKey})]}),(0,a.jsx)("p",{className:"font-medium text-tremor-content-emphasis text-righ ml-2",children:t})]},l)})]})};console.log("selectedProvider: ".concat($)),console.log("providerModels.length: ".concat(G.length));let lo=Object.keys(n).find(e=>n[e]===$);return lo&&(i=Y.find(e=>e.name===eN[lo])),(0,a.jsx)("div",{style:{width:"100%",height:"100%"},children:(0,a.jsxs)(en.Z,{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,a.jsxs)(ea.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)(et.Z,{children:"All Models"}),(0,a.jsx)(et.Z,{children:"Add Model"}),(0,a.jsx)(et.Z,{children:(0,a.jsx)("pre",{children:"/health Models"})}),(0,a.jsx)(et.Z,{children:"Model Analytics"}),(0,a.jsx)(et.Z,{children:"Model Retry Settings"})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[C&&(0,a.jsxs)(_.Z,{children:["Last Refreshed: ",C]}),(0,a.jsx)(M.Z,{icon:ej.Z,variant:"shadow",size:"xs",className:"self-center",onClick:ll})]})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsxs)(er.Z,{children:[(0,a.jsxs)(x.Z,{children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(_.Z,{children:"Filter by Public Model Name"}),(0,a.jsxs)(z.Z,{className:"mb-4 mt-2 ml-2 w-50",defaultValue:eF||eO[0],onValueChange:e=>eM("all"===e?"all":e),value:eF||eO[0],children:[(0,a.jsx)(V.Z,{value:"all",children:"All Models"}),eO.map((e,l)=>(0,a.jsx)(V.Z,{value:e,onClick:()=>eM(e),children:e},l))]})]}),(0,a.jsx)(F.Z,{children:(0,a.jsxs)(L.Z,{style:{maxWidth:"1500px",width:"100%"},children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{style:{maxWidth:"150px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:"Public Model Name"}),(0,a.jsx)(B.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:"Provider"}),"Admin"===c&&(0,a.jsx)(B.Z,{style:{maxWidth:"150px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:"API Base"}),(0,a.jsxs)(B.Z,{style:{maxWidth:"85px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:["Input Price"," ",(0,a.jsx)("p",{style:{fontSize:"10px",color:"gray"},children:"/1M Tokens ($)"})]}),(0,a.jsxs)(B.Z,{style:{maxWidth:"85px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:["Output Price"," ",(0,a.jsx)("p",{style:{fontSize:"10px",color:"gray"},children:"/1M Tokens ($)"})]}),(0,a.jsx)(B.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:Z?"Created At":(0,a.jsxs)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",style:{color:"#72bcd4"},children:[" ","✨ Created At"]})}),(0,a.jsx)(B.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:Z?"Created By":(0,a.jsxs)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",style:{color:"#72bcd4"},children:[" ","✨ Created By"]})}),(0,a.jsx)(B.Z,{style:{maxWidth:"50px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"11px"},children:"Status"}),(0,a.jsx)(B.Z,{})]})}),(0,a.jsx)(U.Z,{children:h.data.filter(e=>"all"===eF||e.model_name===eF||null==eF||""===eF).map((e,l)=>{var s;return(0,a.jsxs)(q.Z,{style:{maxHeight:"1px",minHeight:"1px"},children:[(0,a.jsx)(D.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:e.model_name||"-"})}),(0,a.jsx)(D.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:e.provider||"-"})}),"Admin"===c&&(0,a.jsx)(D.Z,{style:{maxWidth:"150px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsx)(eu.Z,{title:e&&e.api_base,children:(0,a.jsx)("pre",{style:{maxWidth:"150px",whiteSpace:"normal",wordBreak:"break-word",fontSize:"10px"},title:e&&e.api_base?e.api_base:"",children:e&&e.api_base?e.api_base.slice(0,20):"-"})})}),(0,a.jsx)(D.Z,{style:{maxWidth:"80px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsx)("pre",{style:{fontSize:"10px"},children:e.input_cost?e.input_cost:e.litellm_params.input_cost_per_token?(1e6*Number(e.litellm_params.input_cost_per_token)).toFixed(2):null})}),(0,a.jsx)(D.Z,{style:{maxWidth:"80px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsx)("pre",{style:{fontSize:"10px"},children:e.output_cost?e.output_cost:e.litellm_params.output_cost_per_token?(1e6*Number(e.litellm_params.output_cost_per_token)).toFixed(2):null})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:Z&&((s=e.model_info.created_at)?new Date(s).toLocaleDateString("en-US"):null)||"-"})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:Z&&e.model_info.created_by||"-"})}),(0,a.jsx)(D.Z,{style:{maxWidth:"100px",whiteSpace:"normal",wordBreak:"break-word"},children:e.model_info.db_model?(0,a.jsx)(R.Z,{size:"xs",className:"text-white",children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:"DB Model"})}):(0,a.jsx)(R.Z,{size:"xs",className:"text-black",children:(0,a.jsx)("p",{style:{fontSize:"10px"},children:"Config Model"})})}),(0,a.jsx)(D.Z,{style:{maxWidth:"150px",whiteSpace:"normal",wordBreak:"break-word"},children:(0,a.jsxs)(x.Z,{numItems:3,children:[(0,a.jsx)(eh.Z,{children:(0,a.jsx)(M.Z,{icon:P.Z,size:"sm",onClick:()=>e9(e)})}),(0,a.jsx)(eh.Z,{children:(0,a.jsx)(M.Z,{icon:T.Z,size:"sm",onClick:()=>e7(e)})}),(0,a.jsx)(eh.Z,{children:(0,a.jsx)(eg,{modelID:e.model_info.id,accessToken:o})})]})})]},l)})})]})})]}),(0,a.jsx)(e=>{let{visible:l,onCancel:s,model:t,onSubmit:n}=e,[r]=S.Z.useForm(),i={},o="",d="";if(t){i=t.litellm_params,o=t.model_name;let e=t.model_info;e&&(d=e.id,console.log("model_id: ".concat(d)),i.model_id=d)}return(0,a.jsx)(w.Z,{title:"Edit Model "+o,visible:l,width:800,footer:null,onOk:()=>{r.validateFields().then(e=>{n(e),r.resetFields()}).catch(e=>{console.error("Validation failed:",e)})},onCancel:s,children:(0,a.jsxs)(S.Z,{form:r,onFinish:le,initialValues:i,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"api_base",name:"api_base",children:(0,a.jsx)(j.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"tpm",name:"tpm",tooltip:"int (optional) - Tokens limit for this deployment: in tokens per minute (tpm). Find this information on your model/providers website",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"rpm",name:"rpm",tooltip:"int (optional) - Rate limit for this deployment: in requests per minute (rpm). Find this information on your model/providers website",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"max_retries",name:"max_retries",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"timeout",name:"timeout",tooltip:"int (optional) - Timeout in seconds for LLM requests (Defaults to 600 seconds)",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"stream_timeout",name:"stream_timeout",tooltip:"int (optional) - Timeout for stream requests (seconds)",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"input_cost_per_token",name:"input_cost_per_token",tooltip:"float (optional) - Input cost per token",children:(0,a.jsx)(A.Z,{min:0,step:1e-4})}),(0,a.jsx)(S.Z.Item,{label:"output_cost_per_token",name:"output_cost_per_token",tooltip:"float (optional) - Output cost per token",children:(0,a.jsx)(A.Z,{min:0,step:1e-4})}),(0,a.jsx)(S.Z.Item,{label:"model_id",name:"model_id",hidden:!0})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Save"})})]})})},{visible:e_,onCancel:()=>{ey(!1),eT(null)},model:eP,onSubmit:le}),(0,a.jsxs)(w.Z,{title:eP&&eP.model_name,visible:eE,width:800,footer:null,onCancel:()=>{eC(!1),eT(null)},children:[(0,a.jsx)(y.Z,{children:"Model Info"}),(0,a.jsx)(eS.Z,{language:"json",children:eP&&JSON.stringify(eP,null,2)})]})]}),(0,a.jsxs)(er.Z,{className:"h-full",children:[(0,a.jsx)(ek,{level:2,children:"Add new model"}),(0,a.jsx)(F.Z,{children:(0,a.jsxs)(S.Z,{form:v,onFinish:()=>{v.validateFields().then(e=>{eI(e,o,v)}).catch(e=>{console.error("Validation failed:",e)})},labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.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,a.jsx)(z.Z,{value:$.toString(),children:H.map((e,l)=>(0,a.jsx)(V.Z,{value:e,onClick:()=>{ln(e),X(e)},children:e},l))})}),(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Public Model Name",name:"model_name",tooltip:"Model name your users will pass in. Also used for load-balancing, LiteLLM will load balance between all models with this public name.",className:"mb-0",children:(0,a.jsx)(j.Z,{placeholder:"Vertex AI (Anthropic, Gemini, etc.)"===(t=$.toString())?"gemini-pro":"Anthropic"==t?"claude-3-opus":"Amazon Bedrock"==t?"claude-3-opus":"Google AI Studio"==t?"gemini-pro":"gpt-3.5-turbo"})}),(0,a.jsxs)(ex.Z,{children:[(0,a.jsx)(eh.Z,{span:10}),(0,a.jsx)(eh.Z,{span:10,children:(0,a.jsx)(_.Z,{className:"mb-3 mt-1",children:"Model name your users will pass in."})})]}),(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"LiteLLM Model Name(s)",name:"model",tooltip:"Actual model name used for making litellm.completion() call.",className:"mb-0",children:"Azure"===$?(0,a.jsx)(j.Z,{placeholder:"Enter model name"}):G.length>0?(0,a.jsx)(eo.Z,{value:G,children:G.map((e,l)=>(0,a.jsx)(ed.Z,{value:e,children:e},l))}):(0,a.jsx)(j.Z,{placeholder:"gpt-3.5-turbo-0125"})}),(0,a.jsxs)(ex.Z,{children:[(0,a.jsx)(eh.Z,{span:10}),(0,a.jsx)(eh.Z,{span:10,children:(0,a.jsxs)(_.Z,{className:"mb-3 mt-1",children:["Actual model name used for making"," ",(0,a.jsx)(ew,{href:"https://docs.litellm.ai/docs/providers",target:"_blank",children:"litellm.completion() call"}),". We'll"," ",(0,a.jsx)(ew,{href:"https://docs.litellm.ai/docs/proxy/reliability#step-1---set-deployments-on-config",target:"_blank",children:"loadbalance"})," ","models with the same 'public name'"]})})]}),void 0!==i&&i.fields.length>0&&(0,a.jsx)(ev,{fields:i.fields,selectedProvider:i.name}),"Amazon Bedrock"!=$&&"Vertex AI (Anthropic, Gemini, etc.)"!=$&&(void 0===i||0==i.fields.length)&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"API Key",name:"api_key",children:(0,a.jsx)(j.Z,{placeholder:"sk-",type:"password"})}),"OpenAI"==$&&(0,a.jsx)(S.Z.Item,{label:"Organization ID",name:"organization_id",children:(0,a.jsx)(j.Z,{placeholder:"[OPTIONAL] my-unique-org"})}),"Vertex AI (Anthropic, Gemini, etc.)"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Vertex Project",name:"vertex_project",children:(0,a.jsx)(j.Z,{placeholder:"adroit-cadet-1234.."})}),"Vertex AI (Anthropic, Gemini, etc.)"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Vertex Location",name:"vertex_location",children:(0,a.jsx)(j.Z,{placeholder:"us-east-1"})}),"Vertex AI (Anthropic, Gemini, etc.)"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Vertex Credentials",name:"vertex_credentials",className:"mb-0",children:(0,a.jsx)(ef.Z,{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;v.setFieldsValue({vertex_credentials:l})}},l.readAsText(e)}return!1},onChange(e){"uploading"!==e.file.status&&console.log(e.file,e.fileList),"done"===e.file.status?k.ZP.success("".concat(e.file.name," file uploaded successfully")):"error"===e.file.status&&k.ZP.error("".concat(e.file.name," file upload failed."))},children:(0,a.jsx)(I.ZP,{icon:(0,a.jsx)(eZ.Z,{}),children:"Click to Upload"})})}),"Vertex AI (Anthropic, Gemini, etc.)"==$&&(0,a.jsxs)(ex.Z,{children:[(0,a.jsx)(eh.Z,{span:10}),(0,a.jsx)(eh.Z,{span:10,children:(0,a.jsx)(_.Z,{className:"mb-3 mt-1",children:"Give litellm a gcp service account(.json file), so it can make the relevant calls"})})]}),("Azure"==$||"OpenAI-Compatible Endpoints (Groq, Together AI, Mistral AI, etc.)"==$)&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"API Base",name:"api_base",children:(0,a.jsx)(j.Z,{placeholder:"https://..."})}),"Azure"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"API Version",name:"api_version",children:(0,a.jsx)(j.Z,{placeholder:"2023-07-01-preview"})}),"Azure"==$&&(0,a.jsxs)("div",{children:[(0,a.jsx)(S.Z.Item,{label:"Base Model",name:"base_model",className:"mb-0",children:(0,a.jsx)(j.Z,{placeholder:"azure/gpt-3.5-turbo"})}),(0,a.jsxs)(ex.Z,{children:[(0,a.jsx)(eh.Z,{span:10}),(0,a.jsx)(eh.Z,{span:10,children:(0,a.jsxs)(_.Z,{className:"mb-2",children:["The actual model your azure deployment uses. Used for accurate cost tracking. Select name from"," ",(0,a.jsx)(ew,{href:"https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json",target:"_blank",children:"here"})]})})]})]}),"Amazon Bedrock"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"AWS Access Key ID",name:"aws_access_key_id",tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`).",children:(0,a.jsx)(j.Z,{placeholder:""})}),"Amazon Bedrock"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"AWS Secret Access Key",name:"aws_secret_access_key",tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`).",children:(0,a.jsx)(j.Z,{placeholder:""})}),"Amazon Bedrock"==$&&(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"AWS Region Name",name:"aws_region_name",tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`).",children:(0,a.jsx)(j.Z,{placeholder:"us-east-1"})}),(0,a.jsx)(S.Z.Item,{label:"LiteLLM Params",name:"litellm_extra_params",tooltip:"Optional litellm params used for making a litellm.completion() call.",className:"mb-0",children:(0,a.jsx)(ep.Z,{rows:4,placeholder:'{ "rpm": 100, "timeout": 0, "stream_timeout": 0 }'})}),(0,a.jsxs)(ex.Z,{children:[(0,a.jsx)(eh.Z,{span:10}),(0,a.jsx)(eh.Z,{span:10,children:(0,a.jsxs)(_.Z,{className:"mb-3 mt-1",children:["Pass JSON of litellm supported params"," ",(0,a.jsx)(ew,{href:"https://docs.litellm.ai/docs/completion/input",target:"_blank",children:"litellm.completion() call"})]})})]})]}),(0,a.jsx)("div",{style:{textAlign:"center",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Add Model"})}),(0,a.jsx)(eu.Z,{title:"Get help on our github",children:(0,a.jsx)(ee.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})})]})})]}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(_.Z,{children:"`/health` will run a very small request through your models configured on litellm"}),(0,a.jsx)(p.Z,{onClick:la,children:"Run `/health`"}),Q&&(0,a.jsx)("pre",{children:JSON.stringify(Q,null,2)})]})}),(0,a.jsxs)(er.Z,{children:[(0,a.jsxs)(x.Z,{numItems:2,className:"mt-2",children:[(0,a.jsxs)(eh.Z,{children:[(0,a.jsx)(_.Z,{children:"Select Time Range"}),(0,a.jsx)(es.Z,{enableSelect:!0,value:e2,onValueChange:e=>{e4(e),lr(eF,e.from,e.to)}})]}),(0,a.jsxs)(eh.Z,{children:[(0,a.jsx)(_.Z,{children:"Select Model Group"}),(0,a.jsx)(z.Z,{className:"mb-4 mt-2",defaultValue:eF||eO[0],value:eF||eO[0],children:eO.map((e,l)=>(0,a.jsx)(V.Z,{value:e,onClick:()=>lr(e,e2.from,e2.to),children:e},l))})]})]}),(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsx)(eh.Z,{children:(0,a.jsx)(F.Z,{className:"mr-2 max-h-[400px] min-h-[400px]",children:(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{variant:"line",defaultValue:"1",children:[(0,a.jsx)(et.Z,{value:"1",children:"Avg. Latency per Token"}),(0,a.jsx)(et.Z,{value:"2",children:"✨ Time to first token"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsxs)(er.Z,{children:[(0,a.jsx)("p",{className:"text-gray-500 italic",children:" (seconds/token)"}),(0,a.jsx)(_.Z,{className:"text-gray-500 italic mt-1 mb-1",children:"average Latency for successfull requests divided by the total tokens"}),eD&&eB&&(0,a.jsx)(ec.Z,{title:"Model Latency",className:"h-72",data:eD,showLegend:!1,index:"date",categories:eB,connectNulls:!0,customTooltip:li})]}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eb,{modelMetrics:ez,modelMetricsCategories:eG,customTooltip:li,premiumUser:Z})})]})]})})}),(0,a.jsx)(eh.Z,{children:(0,a.jsx)(F.Z,{className:"ml-2 max-h-[400px] min-h-[400px] overflow-y-auto",children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Deployment"}),(0,a.jsx)(B.Z,{children:"Success Responses"}),(0,a.jsxs)(B.Z,{children:["Slow Responses ",(0,a.jsx)("p",{children:"Success Responses taking 600+s"})]})]})}),(0,a.jsx)(U.Z,{children:e0.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.api_base}),(0,a.jsx)(D.Z,{children:e.total_count}),(0,a.jsx)(D.Z,{children:e.slow_count})]},l))})]})})})]}),(0,a.jsxs)(F.Z,{className:"mt-4",children:[(0,a.jsx)(y.Z,{children:"Exceptions per Model"}),(0,a.jsx)(em.Z,{className:"h-72",data:eH,index:"model",categories:eJ,stack:!0,yAxisWidth:30})]})]}),(0,a.jsxs)(er.Z,{children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(_.Z,{children:"Filter by Public Model Name"}),(0,a.jsx)(z.Z,{className:"mb-4 mt-2 ml-2 w-50",defaultValue:eF||eO[0],value:eF||eO[0],onValueChange:e=>eM(e),children:eO.map((e,l)=>(0,a.jsx)(V.Z,{value:e,onClick:()=>eM(e),children:e},l))})]}),(0,a.jsxs)(y.Z,{children:["Retry Policy for ",eF]}),(0,a.jsx)(_.Z,{className:"mb-6",children:"How many retries should be attempted based on the Exception"}),eA&&(0,a.jsx)("table",{children:(0,a.jsx)("tbody",{children:Object.entries(eA).map((e,l)=>{var s;let[t,n]=e,r=null==e5?void 0:null===(s=e5[eF])||void 0===s?void 0:s[n];return null==r&&(r=e3),(0,a.jsxs)("tr",{className:"flex justify-between items-center mt-2",children:[(0,a.jsx)("td",{children:(0,a.jsx)(_.Z,{children:t})}),(0,a.jsx)("td",{children:(0,a.jsx)(A.Z,{className:"ml-5",value:r,min:0,step:1,onChange:e=>{e8(l=>{var s;let t=null!==(s=null==l?void 0:l[eF])&&void 0!==s?s:{};return{...null!=l?l:{},[eF]:{...t,[n]:e}}})}})})]},l)})})}),(0,a.jsx)(p.Z,{className:"mt-6 mr-8",onClick:ls,children:"Save"})]})]})]})})};let{Option:eC}=v.default;var eP=e=>{let{userID:l,accessToken:s,teams:t}=e,[n]=S.Z.useForm(),[i,o]=(0,r.useState)(!1),[d,c]=(0,r.useState)(null),[m,h]=(0,r.useState)([]);(0,r.useEffect)(()=>{(async()=>{try{let e=await (0,u.So)(s,l,"any"),t=[];for(let l=0;l{o(!1),n.resetFields()},g=()=>{o(!1),c(null),n.resetFields()},Z=async e=>{try{k.ZP.info("Making API Call"),o(!0),console.log("formValues in create user:",e);let t=await (0,u.Ov)(s,null,e);console.log("user create Response:",t),c(t.key),k.ZP.success("API user Created"),n.resetFields(),localStorage.removeItem("userData"+l)}catch(e){console.error("Error creating the user:",e)}};return(0,a.jsxs)("div",{children:[(0,a.jsx)(p.Z,{className:"mx-auto mb-0",onClick:()=>o(!0),children:"+ Invite User"}),(0,a.jsxs)(w.Z,{title:"Invite User",visible:i,width:800,footer:null,onOk:x,onCancel:g,children:[(0,a.jsx)(_.Z,{className:"mb-1",children:"Invite a user to login to the Admin UI and create Keys"}),(0,a.jsx)(_.Z,{className:"mb-6",children:(0,a.jsx)("b",{children:"Note: SSO Setup Required for this"})}),(0,a.jsxs)(S.Z,{form:n,onFinish:Z,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsx)(S.Z.Item,{label:"User Email",name:"user_email",children:(0,a.jsx)(j.Z,{placeholder:""})}),(0,a.jsx)(S.Z.Item,{label:"Team ID",name:"team_id",children:(0,a.jsx)(v.default,{placeholder:"Select Team ID",style:{width:"100%"},children:t?t.map(e=>(0,a.jsx)(eC,{value:e.team_id,children:e.team_alias},e.team_id)):(0,a.jsx)(eC,{value:null,children:"Default Team"},"default")})}),(0,a.jsx)(S.Z.Item,{label:"Metadata",name:"metadata",children:(0,a.jsx)(N.Z.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Create User"})})]})]}),d&&(0,a.jsxs)(w.Z,{title:"User Created Successfully",visible:i,onOk:x,onCancel:g,footer:null,children:[(0,a.jsx)("p",{children:"User has been created to access your proxy. Please Ask them to Log In."}),(0,a.jsx)("br",{}),(0,a.jsx)("p",{children:(0,a.jsx)("b",{children:"Note: This Feature is only supported through SSO on the Admin UI"})})]})]})},eT=e=>{let{visible:l,onCancel:s,user:t,onSubmit:n}=e,[i,o]=(0,r.useState)(t),[d]=S.Z.useForm();(0,r.useEffect)(()=>{d.resetFields()},[t]);let c=async()=>{d.resetFields(),s()},m=async e=>{d.resetFields(),n(e),s()};return t?(0,a.jsx)(w.Z,{visible:l,onCancel:c,footer:null,title:"Edit User "+t.user_id,width:1e3,children:(0,a.jsx)(S.Z,{form:d,onFinish:m,initialValues:t,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"User Email",tooltip:"Email of the User",name:"user_email",children:(0,a.jsx)(j.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"user_id",name:"user_id",hidden:!0,children:(0,a.jsx)(j.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"User Role",name:"user_role",children:(0,a.jsxs)(v.default,{children:[(0,a.jsx)(v.default.Option,{value:"proxy_admin",children:"Proxy Admin (Can create, edit, delete keys, teams)"}),(0,a.jsx)(v.default.Option,{value:"proxy_admin_viewer",children:"Proxy Viewer (Can just view spend, cannot created keys, teams)"})]})}),(0,a.jsx)(S.Z.Item,{label:"Spend (USD)",name:"spend",tooltip:"(float) - Spend of all LLM calls completed by this user",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)(S.Z.Item,{label:"User Budget (USD)",name:"max_budget",tooltip:"(float) - Maximum budget of this user",children:(0,a.jsx)(A.Z,{min:0,step:1})}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Save"})})]})})}):null},eO=e=>{let{accessToken:l,token:s,keys:t,userRole:n,userID:i,teams:o,setKeys:d}=e,[c,m]=(0,r.useState)(null),[h,p]=(0,r.useState)(null),[j,g]=(0,r.useState)(0),[Z,f]=r.useState(null),[y,b]=(0,r.useState)(null),[v,S]=(0,r.useState)(!1),[k,w]=(0,r.useState)(null),N=async()=>{w(null),S(!1)},A=async e=>{console.log("inside handleEditSubmit:",e),l&&s&&n&&i&&((0,u.pf)(l,e,n),c&&m(c.map(l=>l.user_id===e.user_id?e:l)),w(null),S(!1))};return((0,r.useEffect)(()=>{if(!l||!s||!n||!i)return;let e=async()=>{try{let e=await (0,u.Br)(l,null,n,!0,j,25);console.log("user data response:",e),m(e)}catch(e){console.error("There was an error fetching the model data",e)}};l&&s&&n&&i&&e()},[l,s,n,i,j]),c&&l&&s&&n&&i)?(0,a.jsx)("div",{style:{width:"100%"},children:(0,a.jsxs)(x.Z,{className:"gap-2 p-2 h-[80vh] w-full mt-8",children:[(0,a.jsx)(eP,{userID:i,accessToken:l,teams:o}),(0,a.jsxs)(F.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[80vh] mb-4",children:[(0,a.jsx)("div",{className:"mb-4 mt-1",children:(0,a.jsx)(_.Z,{children:"These are Users on LiteLLM that created API Keys. Automatically tracked by LiteLLM"})}),(0,a.jsx)(en.Z,{children:(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsxs)(L.Z,{className:"mt-5",children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"User ID"}),(0,a.jsx)(B.Z,{children:"User Email"}),(0,a.jsx)(B.Z,{children:"User Models"}),(0,a.jsx)(B.Z,{children:"User Spend ($ USD)"}),(0,a.jsx)(B.Z,{children:"User Max Budget ($ USD)"}),(0,a.jsx)(B.Z,{children:"API Keys"}),(0,a.jsx)(B.Z,{})]})}),(0,a.jsx)(U.Z,{children:c.map(e=>{var l;return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.user_id}),(0,a.jsx)(D.Z,{children:e.user_email}),(0,a.jsx)(D.Z,{children:e.models&&e.models.length>0?e.models:"All Models"}),(0,a.jsx)(D.Z,{children:e.spend?null===(l=e.spend)||void 0===l?void 0:l.toFixed(2):0}),(0,a.jsx)(D.Z,{children:e.max_budget?e.max_budget:"Unlimited"}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(x.Z,{numItems:2,children:e&&e.key_aliases&&e.key_aliases.filter(e=>null!==e).length>0?(0,a.jsxs)(R.Z,{size:"xs",color:"indigo",children:[e.key_aliases.filter(e=>null!==e).length,"\xa0Keys"]}):(0,a.jsx)(R.Z,{size:"xs",color:"gray",children:"No Keys"})})}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(M.Z,{icon:P.Z,onClick:()=>{f(e.user_id),b(e)},children:"View Keys"}),(0,a.jsx)(M.Z,{icon:T.Z,onClick:()=>{w(e),S(!0)},children:"View Keys"}),(0,a.jsx)(M.Z,{icon:O.Z,onClick:()=>{f(e.user_id),b(e)},children:"View Keys"})]})]},e.user_id)})})]})}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsx)("div",{className:"flex-1 flex justify-between items-center"})]})})]})}),(0,a.jsx)(eT,{visible:v,onCancel:N,user:k,onSubmit:A})]}),function(){if(!c)return null;let e=Math.ceil(c.length/25);return(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsxs)("div",{children:["Showing Page ",j+1," of ",e]}),(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)("button",{className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-l focus:outline-none",disabled:0===j,onClick:()=>g(j-1),children:"← Prev"}),(0,a.jsx)("button",{className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-r focus:outline-none",onClick:()=>{g(j+1)},children:"Next →"})]})]})}()]})}):(0,a.jsx)("div",{children:"Loading..."})},eR=e=>{let{teams:l,searchParams:s,accessToken:t,setTeams:n,userID:i,userRole:o}=e,[d]=S.Z.useForm(),[c]=S.Z.useForm(),{Title:m,Paragraph:g}=ee.default,[Z,f]=(0,r.useState)(""),[y,b]=(0,r.useState)(!1),[E,C]=(0,r.useState)(l?l[0]:null),[P,G]=(0,r.useState)(!1),[W,H]=(0,r.useState)(!1),[Y,J]=(0,r.useState)([]),[$,X]=(0,r.useState)(!1),[Q,el]=(0,r.useState)(null),[es,et]=(0,r.useState)({}),en=e=>{C(e),b(!0)},ea=async e=>{let s=e.team_id;if(console.log("handleEditSubmit:",e),null==t)return;let a=await (0,u.Gh)(t,e);l&&n(l.map(e=>e.team_id===s?a.data:e)),k.ZP.success("Team updated successfully"),b(!1),C(null)},er=async e=>{el(e),X(!0)},ei=async()=>{if(null!=Q&&null!=l&&null!=t){try{await (0,u.rs)(t,Q);let e=l.filter(e=>e.team_id!==Q);n(e)}catch(e){console.error("Error deleting the team:",e)}X(!1),el(null)}};(0,r.useEffect)(()=>{let e=async()=>{try{if(null===i||null===o||null===t||null===l)return;console.log("fetching team info:");let e={};for(let s=0;s<(null==l?void 0:l.length);s++){let n=l[s].team_id,a=await (0,u.Xm)(t,n);console.log("teamInfo response:",a),null!==a&&(e={...e,[n]:a})}et(e)}catch(e){console.error("Error fetching team info:",e)}};(async()=>{try{if(null===i||null===o)return;if(null!==t){let e=(await (0,u.So)(t,i,o)).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,o,l]);let eo=async e=>{try{if(null!=t){var s;let a=null==e?void 0:e.team_alias;if((null!==(s=null==l?void 0:l.map(e=>e.team_alias))&&void 0!==s?s:[]).includes(a))throw Error("Team alias ".concat(a," already exists, please pick another alias"));k.ZP.info("Creating Team");let r=await (0,u.hT)(t,e);null!==l?n([...l,r]):n([r]),console.log("response for team create call: ".concat(r)),k.ZP.success("Team created"),G(!1)}}catch(e){console.error("Error creating the team:",e),k.ZP.error("Error creating the team: "+e,20)}},ed=async e=>{try{if(null!=t&&null!=l){k.ZP.info("Adding Member");let s={role:"user",user_email:e.user_email,user_id:e.user_id},a=await (0,u.cu)(t,E.team_id,s);console.log("response for team create call: ".concat(a.data));let r=l.findIndex(e=>(console.log("team.team_id=".concat(e.team_id,"; response.data.team_id=").concat(a.data.team_id)),e.team_id===a.data.team_id));if(console.log("foundIndex: ".concat(r)),-1!==r){let e=[...l];e[r]=a.data,n(e),C(a.data)}H(!1)}}catch(e){console.error("Error creating the team:",e)}};return console.log("received teams ".concat(JSON.stringify(l))),(0,a.jsx)("div",{className:"w-full mx-4",children:(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)(m,{level:4,children:"All Teams"}),(0,a.jsxs)(F.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:[(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Team Name"}),(0,a.jsx)(B.Z,{children:"Spend (USD)"}),(0,a.jsx)(B.Z,{children:"Budget (USD)"}),(0,a.jsx)(B.Z,{children:"Models"}),(0,a.jsx)(B.Z,{children:"TPM / RPM Limits"}),(0,a.jsx)(B.Z,{children:"Info"})]})}),(0,a.jsx)(U.Z,{children:l&&l.length>0?l.map(e=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.team_alias}),(0,a.jsx)(D.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.spend}),(0,a.jsx)(D.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.max_budget?e.max_budget:"No limit"}),(0,a.jsx)(D.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},children:Array.isArray(e.models)?(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:0===e.models.length?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Proxy Models"})}):e.models.map((e,l)=>"all-proxy-models"===e?(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(_.Z,{children:"All Proxy Models"})},l):(0,a.jsx)(R.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,a.jsx)(_.Z,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},l))}):null}),(0,a.jsx)(D.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:(0,a.jsxs)(_.Z,{children:["TPM: ",e.tpm_limit?e.tpm_limit:"Unlimited"," ",(0,a.jsx)("br",{}),"RPM:"," ",e.rpm_limit?e.rpm_limit:"Unlimited"]})}),(0,a.jsxs)(D.Z,{children:[(0,a.jsxs)(_.Z,{children:[es&&e.team_id&&es[e.team_id]&&es[e.team_id].keys&&es[e.team_id].keys.length," ","Keys"]}),(0,a.jsxs)(_.Z,{children:[es&&e.team_id&&es[e.team_id]&&es[e.team_id].team_info&&es[e.team_id].team_info.members_with_roles&&es[e.team_id].team_info.members_with_roles.length," ","Members"]})]}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(M.Z,{icon:T.Z,size:"sm",onClick:()=>en(e)}),(0,a.jsx)(M.Z,{onClick:()=>er(e.team_id),icon:O.Z,size:"sm"})]})]},e.team_id)):null})]}),$&&(0,a.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,a.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,a.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,a.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,a.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,a.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,a.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,a.jsx)("div",{className:"sm:flex sm:items-start",children:(0,a.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,a.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Team"}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this team ?"})})]})})}),(0,a.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,a.jsx)(p.Z,{onClick:ei,color:"red",className:"ml-2",children:"Delete"}),(0,a.jsx)(p.Z,{onClick:()=>{X(!1),el(null)},children:"Cancel"})]})]})]})})]})]}),(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)(p.Z,{className:"mx-auto",onClick:()=>G(!0),children:"+ Create New Team"}),(0,a.jsx)(w.Z,{title:"Create Team",visible:P,width:800,footer:null,onOk:()=>{G(!1),d.resetFields()},onCancel:()=>{G(!1),d.resetFields()},children:(0,a.jsxs)(S.Z,{form:d,onFinish:eo,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,a.jsx)(j.Z,{placeholder:""})}),(0,a.jsx)(S.Z.Item,{label:"Models",name:"models",children:(0,a.jsxs)(v.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,a.jsx)(v.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),Y.map(e=>(0,a.jsx)(v.default.Option,{value:e,children:e},e))]})}),(0,a.jsx)(S.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(A.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,a.jsx)(A.Z,{step:1,width:400})}),(0,a.jsx)(S.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,a.jsx)(A.Z,{step:1,width:400})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Create Team"})})]})})]}),(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)(m,{level:4,children:"Team Members"}),(0,a.jsx)(g,{children:"If you belong to multiple teams, this setting controls which teams members you see."}),l&&l.length>0?(0,a.jsx)(z.Z,{defaultValue:"0",children:l.map((e,l)=>(0,a.jsx)(V.Z,{value:String(l),onClick:()=>{C(e)},children:e.team_alias},l))}):(0,a.jsxs)(g,{children:["No team created. ",(0,a.jsx)("b",{children:"Defaulting to personal account."})]})]}),(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)(F.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Member Name"}),(0,a.jsx)(B.Z,{children:"Role"})]})}),(0,a.jsx)(U.Z,{children:E?E.members_with_roles.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.user_email?e.user_email:e.user_id?e.user_id:null}),(0,a.jsx)(D.Z,{children:e.role})]},l)):null})]})}),E&&(0,a.jsx)(e=>{let{visible:l,onCancel:s,team:t,onSubmit:n}=e,[r]=S.Z.useForm();return(0,a.jsx)(w.Z,{title:"Edit Team",visible:l,width:800,footer:null,onOk:()=>{r.validateFields().then(e=>{n({...e,team_id:t.team_id}),r.resetFields()}).catch(e=>{console.error("Validation failed:",e)})},onCancel:s,children:(0,a.jsxs)(S.Z,{form:r,onFinish:ea,initialValues:t,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,a.jsx)(j.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"Models",name:"models",children:(0,a.jsxs)(v.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,a.jsx)(v.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),Y&&Y.map(e=>(0,a.jsx)(v.default.Option,{value:e,children:e},e))]})}),(0,a.jsx)(S.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(A.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,a.jsx)(A.Z,{step:1,width:400})}),(0,a.jsx)(S.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,a.jsx)(A.Z,{step:1,width:400})}),(0,a.jsx)(S.Z.Item,{label:"Requests per minute Limit (RPM)",name:"team_id",hidden:!0})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Edit Team"})})]})})},{visible:y,onCancel:()=>{b(!1),C(null)},team:E,onSubmit:ea})]}),(0,a.jsxs)(h.Z,{numColSpan:1,children:[(0,a.jsx)(p.Z,{className:"mx-auto mb-5",onClick:()=>H(!0),children:"+ Add member"}),(0,a.jsx)(w.Z,{title:"Add member",visible:W,width:800,footer:null,onOk:()=>{H(!1),c.resetFields()},onCancel:()=>{H(!1),c.resetFields()},children:(0,a.jsxs)(S.Z,{form:d,onFinish:ed,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Email",name:"user_email",className:"mb-4",children:(0,a.jsx)(N.Z,{name:"user_email",className:"px-3 py-2 border rounded-md w-full"})}),(0,a.jsx)("div",{className:"text-center mb-4",children:"OR"}),(0,a.jsx)(S.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,a.jsx)(N.Z,{name:"user_id",className:"px-3 py-2 border rounded-md w-full"})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Add member"})})]})})]})]})})},eF=e=>{let l,{searchParams:s,accessToken:t,showSSOBanner:n}=e,[i]=S.Z.useForm(),[o]=S.Z.useForm(),{Title:d,Paragraph:c}=ee.default,[m,j]=(0,r.useState)(""),[g,Z]=(0,r.useState)(null),[f,y]=(0,r.useState)(!1),[b,v]=(0,r.useState)(!1),[A,E]=(0,r.useState)(!1),[C,P]=(0,r.useState)(!1),[O,R]=(0,r.useState)(!1);try{l=window.location.origin}catch(e){l=""}l+="/fallback/login";let G=()=>{R(!1)},W=["proxy_admin","proxy_admin_viewer"];(0,r.useEffect)(()=>{(async()=>{if(null!=t){let e=[],l=await (0,u.Xd)(t,"proxy_admin_viewer");l.forEach(l=>{e.push({user_role:l.user_role,user_id:l.user_id,user_email:l.user_email})}),console.log("proxy viewers: ".concat(l));let s=await (0,u.Xd)(t,"proxy_admin");s.forEach(l=>{e.push({user_role:l.user_role,user_id:l.user_id,user_email:l.user_email})}),console.log("proxy admins: ".concat(s)),console.log("combinedList: ".concat(e)),Z(e)}})()},[t]);let H=()=>{E(!1),o.resetFields()},Y=()=>{E(!1),o.resetFields()},J=e=>(0,a.jsxs)(S.Z,{form:i,onFinish:e,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Email",name:"user_email",className:"mb-4",children:(0,a.jsx)(N.Z,{name:"user_email",className:"px-3 py-2 border rounded-md w-full"})}),(0,a.jsx)("div",{className:"text-center mb-4",children:"OR"}),(0,a.jsx)(S.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,a.jsx)(N.Z,{name:"user_id",className:"px-3 py-2 border rounded-md w-full"})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Add member"})})]}),$=(e,l,s)=>(0,a.jsxs)(S.Z,{form:i,onFinish:e,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{rules:[{required:!0,message:"Required"}],label:"User Role",name:"user_role",labelCol:{span:10},labelAlign:"left",children:(0,a.jsx)(z.Z,{value:l,children:W.map((e,l)=>(0,a.jsx)(V.Z,{value:e,children:e},l))})}),(0,a.jsx)(S.Z.Item,{label:"Team ID",name:"user_id",hidden:!0,initialValue:s,valuePropName:"user_id",className:"mt-8",children:(0,a.jsx)(N.Z,{value:s,disabled:!0})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Update role"})})]}),X=async e=>{try{if(null!=t&&null!=g){k.ZP.info("Making API Call");let l=await (0,u.pf)(t,e,null);console.log("response for team create call: ".concat(l));let s=g.findIndex(e=>(console.log("user.user_id=".concat(e.user_id,"; response.user_id=").concat(l.user_id)),e.user_id===l.user_id));console.log("foundIndex: ".concat(s)),-1==s&&(console.log("updates admin with new user"),g.push(l),Z(g)),k.ZP.success("Refresh tab to see updated user role"),E(!1)}}catch(e){console.error("Error creating the key:",e)}},Q=async e=>{try{if(null!=t&&null!=g){k.ZP.info("Making API Call");let l=await (0,u.pf)(t,e,"proxy_admin_viewer");console.log("response for team create call: ".concat(l));let s=g.findIndex(e=>(console.log("user.user_id=".concat(e.user_id,"; response.user_id=").concat(l.user_id)),e.user_id===l.user_id));console.log("foundIndex: ".concat(s)),-1==s&&(console.log("updates admin with new user"),g.push(l),Z(g)),y(!1)}}catch(e){console.error("Error creating the key:",e)}},el=async e=>{try{if(null!=t&&null!=g){k.ZP.info("Making API Call"),e.user_email,e.user_id;let l=await (0,u.pf)(t,e,"proxy_admin");console.log("response for team create call: ".concat(l));let s=g.findIndex(e=>(console.log("user.user_id=".concat(e.user_id,"; response.user_id=").concat(l.user_id)),e.user_id===l.user_id));console.log("foundIndex: ".concat(s)),-1==s&&(console.log("updates admin with new user"),g.push(l),Z(g)),v(!1)}}catch(e){console.error("Error creating the key:",e)}},es=async e=>{if(null==t)return;let l={environment_variables:{PROXY_BASE_URL:e.proxy_base_url,GOOGLE_CLIENT_ID:e.google_client_id,GOOGLE_CLIENT_SECRET:e.google_client_secret}};(0,u.K_)(t,l)};return console.log("admins: ".concat(null==g?void 0:g.length)),(0,a.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,a.jsx)(d,{level:4,children:"Admin Access "}),(0,a.jsxs)(c,{children:[n&&(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/ui#restrict-ui-access",children:"Requires SSO Setup"}),(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Proxy Admin: "})," Can create keys, teams, users, add models, etc. ",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Proxy Admin Viewer: "}),"Can just view spend. They cannot create keys, teams or grant users access to new models."," "]}),(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 p-2 w-full",children:[(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsx)(F.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Member Name"}),(0,a.jsx)(B.Z,{children:"Role"})]})}),(0,a.jsx)(U.Z,{children:g?g.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.user_email?e.user_email:e.user_id?e.user_id:null}),(0,a.jsx)(D.Z,{children:e.user_role}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(M.Z,{icon:T.Z,size:"sm",onClick:()=>E(!0)}),(0,a.jsx)(w.Z,{title:"Update role",visible:A,width:800,footer:null,onOk:H,onCancel:Y,children:$(X,e.user_role,e.user_id)})]})]},l)):null})]})})}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)("div",{className:"flex justify-start",children:[(0,a.jsx)(p.Z,{className:"mr-4 mb-5",onClick:()=>v(!0),children:"+ Add admin"}),(0,a.jsx)(w.Z,{title:"Add admin",visible:b,width:800,footer:null,onOk:()=>{v(!1),o.resetFields()},onCancel:()=>{v(!1),o.resetFields()},children:J(el)}),(0,a.jsx)(p.Z,{className:"mb-5",onClick:()=>y(!0),children:"+ Add viewer"}),(0,a.jsx)(w.Z,{title:"Add viewer",visible:f,width:800,footer:null,onOk:()=>{y(!1),o.resetFields()},onCancel:()=>{y(!1),o.resetFields()},children:J(Q)})]})})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsx)(d,{level:4,children:"Add SSO"}),(0,a.jsxs)("div",{className:"flex justify-start mb-4",children:[(0,a.jsx)(p.Z,{onClick:()=>P(!0),children:"Add SSO"}),(0,a.jsx)(w.Z,{title:"Add SSO",visible:C,width:800,footer:null,onOk:()=>{P(!1),i.resetFields()},onCancel:()=>{P(!1),i.resetFields()},children:(0,a.jsxs)(S.Z,{form:i,onFinish:e=>{el(e),es(e),P(!1),R(!0)},labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Admin Email",name:"user_email",rules:[{required:!0,message:"Please enter the email of the proxy admin"}],children:(0,a.jsx)(N.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"PROXY BASE URL",name:"proxy_base_url",rules:[{required:!0,message:"Please enter the proxy base url"}],children:(0,a.jsx)(N.Z,{})}),(0,a.jsx)(S.Z.Item,{label:"GOOGLE CLIENT ID",name:"google_client_id",rules:[{required:!0,message:"Please enter the google client id"}],children:(0,a.jsx)(N.Z.Password,{})}),(0,a.jsx)(S.Z.Item,{label:"GOOGLE CLIENT SECRET",name:"google_client_secret",rules:[{required:!0,message:"Please enter the google client secret"}],children:(0,a.jsx)(N.Z.Password,{})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Save"})})]})}),(0,a.jsxs)(w.Z,{title:"SSO Setup Instructions",visible:O,width:800,footer:null,onOk:G,onCancel:()=>{R(!1)},children:[(0,a.jsx)("p",{children:"Follow these steps to complete the SSO setup:"}),(0,a.jsx)(_.Z,{className:"mt-2",children:"1. DO NOT Exit this TAB"}),(0,a.jsx)(_.Z,{className:"mt-2",children:"2. Open a new tab, visit your proxy base url"}),(0,a.jsx)(_.Z,{className:"mt-2",children:"3. Confirm your SSO is configured correctly and you can login on the new Tab"}),(0,a.jsx)(_.Z,{className:"mt-2",children:"4. If Step 3 is successful, you can close this tab"}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{onClick:G,children:"Done"})})]})]}),(0,a.jsxs)(e_.Z,{title:"Login without SSO",color:"teal",children:["If you need to login without sso, you can access ",(0,a.jsxs)("a",{href:l,target:"_blank",children:[(0,a.jsx)("b",{children:l})," "]})]})]})]})},eM=s(42556),eL=s(90252),eU=e=>{let{alertingSettings:l,handleInputChange:s,handleResetField:t,handleSubmit:n,premiumUser:r}=e,[i]=S.Z.useForm();return(0,a.jsxs)(S.Z,{form:i,onFinish:()=>{let e=i.getFieldsValue();Object.values(e).some(e=>""===e||null==e)?console.log("Some form fields are empty."):n(e)},labelAlign:"left",children:[l.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsxs)(D.Z,{align:"center",children:[(0,a.jsx)(_.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)(D.Z,{children:"Integer"===e.field_type?(0,a.jsx)(A.Z,{step:1,value:e.field_value,onChange:l=>s(e.field_name,l)}):(0,a.jsx)(N.Z,{value:e.field_value,onChange:l=>s(e.field_name,l)})})}):(0,a.jsx)(D.Z,{children:(0,a.jsx)(p.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",children:(0,a.jsx)(D.Z,{children:"Integer"===e.field_type?(0,a.jsx)(A.Z,{step:1,value:e.field_value,onChange:l=>s(e.field_name,l),className:"p-0"}):(0,a.jsx)(N.Z,{value:e.field_value,onChange:l=>s(e.field_name,l)})})}),(0,a.jsx)(D.Z,{children:!0==e.stored_in_db?(0,a.jsx)(R.Z,{icon:eL.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,a.jsx)(R.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,a.jsx)(R.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(M.Z,{icon:O.Z,color:"red",onClick:()=>t(e.field_name,l),children:"Reset"})})]},l)),(0,a.jsx)("div",{children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Update Settings"})})]})},eD=e=>{let{accessToken:l,premiumUser:s}=e,[t,n]=(0,r.useState)([]);return console.log("INSIDE ALERTING SETTINGS"),(0,r.useEffect)(()=>{l&&(0,u.RQ)(l).then(e=>{n(e)})},[l]),(0,a.jsx)(eU,{alertingSettings:t,handleInputChange:(e,l)=>{n(t.map(s=>s.field_name===e?{...s,field_value:l}: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);console.log("INSIDE HANDLE RESET FIELD"),n(l)}catch(e){console.log("ERROR OCCURRED!")}},handleSubmit:e=>{if(!l||null==e||void 0==e)return;let s={};t.forEach(e=>{s[e.field_name]=e.field_value});let n={...e,...s};try{(0,u.jA)(l,"alerting_args",n),k.ZP.success("Wait 10s for proxy to update.")}catch(e){}},premiumUser:s})};let eK=[{name:"slack",variables:{LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:null,LANGFUSE_SECRET_KEY:null,OPENMETER_API_KEY:null,SLACK_WEBHOOK_URL:null}},{name:"langfuse",variables:{LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:null,LANGFUSE_SECRET_KEY:null,OPENMETER_API_KEY:null,SLACK_WEBHOOK_URL:null}},{name:"openmeter",variables:{LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:null,LANGFUSE_SECRET_KEY:null,OPENMETER_API_KEY:null,SLACK_WEBHOOK_URL:null}}];var eB=e=>{let{accessToken:l,userRole:s,userID:t,premiumUser:n}=e,[i,o]=(0,r.useState)(eK),[d,c]=(0,r.useState)([]),[m,h]=(0,r.useState)(!1),[g]=S.Z.useForm(),[Z,f]=(0,r.useState)(null),[b,N]=(0,r.useState)([]),[A,E]=(0,r.useState)(""),[C,P]=(0,r.useState)({}),[T,O]=(0,r.useState)([]),M=e=>{T.includes(e)?O(T.filter(l=>l!==e)):O([...T,e])},z={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,r.useEffect)(()=>{l&&s&&t&&(0,u.BL)(l,t,s).then(e=>{console.log("callbacks",e);let l=eK;o(l=l.map(l=>{let s=e.callbacks.find(e=>e.name===l.name);return s?{...l,variables:{...l.variables,...s.variables}}:l}));let s=e.alerts;if(console.log("alerts_data",s),s&&s.length>0){let e=s[0];console.log("_alert_info",e);let l=e.variables.SLACK_WEBHOOK_URL;console.log("catch_all_webhook",l),O(e.active_alerts),E(l),P(e.alerts_to_webhook)}c(s)})},[l,s,t]);let V=e=>T&&T.includes(e),G=()=>{if(!l)return;let e={};d.filter(e=>"email"===e.name).forEach(l=>{var s;Object.entries(null!==(s=l.variables)&&void 0!==s?s:{}).forEach(l=>{let[s,t]=l,n=document.querySelector('input[name="'.concat(s,'"]'));n&&n.value&&(e[s]=null==n?void 0:n.value)})}),console.log("updatedVariables",e);try{(0,u.K_)(l,{general_settings:{alerting:["email"]},environment_variables:e})}catch(e){k.ZP.error("Failed to update alerts: "+e,20)}k.ZP.success("Email settings updated successfully")},W=e=>{if(!l)return;let s=Object.fromEntries(Object.entries(e.variables).map(e=>{var l;let[s,t]=e;return[s,(null===(l=document.querySelector('input[name="'.concat(s,'"]')))||void 0===l?void 0:l.value)||t]}));console.log("updatedVariables",s),console.log("updateAlertTypes",b);let t={environment_variables:s,litellm_settings:{success_callback:[e.name]}};try{(0,u.K_)(l,t)}catch(e){k.ZP.error("Failed to update callback: "+e,20)}k.ZP.success("Callback updated successfully")},H=()=>{l&&g.validateFields().then(e=>{let s;if(console.log("Form values:",e),"langfuse"===e.callback){s={environment_variables:{LANGFUSE_PUBLIC_KEY:e.langfusePublicKey,LANGFUSE_SECRET_KEY:e.langfusePrivateKey},litellm_settings:{success_callback:[e.callback]}},(0,u.K_)(l,s);let t={name:e.callback,variables:{SLACK_WEBHOOK_URL:null,LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:e.langfusePublicKey,LANGFUSE_SECRET_KEY:e.langfusePrivateKey,OPENMETER_API_KEY:null}};o(i?[...i,t]:[t])}else if("slack"===e.callback){console.log("values.slackWebhookUrl: ".concat(e.slackWebhookUrl)),s={general_settings:{alerting:["slack"],alerting_threshold:300},environment_variables:{SLACK_WEBHOOK_URL:e.slackWebhookUrl}},(0,u.K_)(l,s),console.log("values.callback: ".concat(e.callback));let t={name:e.callback,variables:{SLACK_WEBHOOK_URL:e.slackWebhookUrl,LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:null,LANGFUSE_SECRET_KEY:null,OPENMETER_API_KEY:null}};o(i?[...i,t]:[t])}else if("openmeter"==e.callback){console.log("values.openMeterApiKey: ".concat(e.openMeterApiKey)),s={environment_variables:{OPENMETER_API_KEY:e.openMeterApiKey},litellm_settings:{success_callback:[e.callback]}},(0,u.K_)(l,s);let t={name:e.callback,variables:{SLACK_WEBHOOK_URL:null,LANGFUSE_HOST:null,LANGFUSE_PUBLIC_KEY:null,LANGFUSE_SECRET_KEY:null,OPENMETER_API_KEY:e.openMeterAPIKey}};o(i?[...i,t]:[t])}else s={error:"Invalid callback value"};h(!1),g.resetFields(),f(null)})};return l?(console.log("callbacks: ".concat(i)),(0,a.jsxs)("div",{className:"w-full mx-4",children:[(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:[(0,a.jsx)(e_.Z,{title:"[UI] Presidio PII + Guardrails Coming Soon. https://docs.litellm.ai/docs/proxy/pii_masking",color:"sky"}),(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{variant:"line",defaultValue:"1",children:[(0,a.jsx)(et.Z,{value:"1",children:"Logging Callbacks"}),(0,a.jsx)(et.Z,{value:"2",children:"Alerting Types"}),(0,a.jsx)(et.Z,{value:"3",children:"Alerting Settings"}),(0,a.jsx)(et.Z,{value:"4",children:"Email Alerts"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsx)(F.Z,{children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Callback"}),(0,a.jsx)(B.Z,{children:"Callback Env Vars"})]})}),(0,a.jsx)(U.Z,{children:i.filter(e=>"slack"!==e.name).map((e,s)=>{var t;return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:(0,a.jsx)(R.Z,{color:"emerald",children:e.name})}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)("ul",{children:Object.entries(null!==(t=e.variables)&&void 0!==t?t:{}).filter(l=>{let[s,t]=l;return s.toLowerCase().includes(e.name)}).map(e=>{let[l,s]=e;return(0,a.jsxs)("li",{children:[(0,a.jsx)(_.Z,{className:"mt-2",children:l}),"LANGFUSE_HOST"===l?(0,a.jsx)("p",{children:"default value=https://cloud.langfuse.com"}):(0,a.jsx)("div",{}),(0,a.jsx)(j.Z,{name:l,defaultValue:s,type:"password"})]},l)})}),(0,a.jsx)(p.Z,{className:"mt-2",onClick:()=>W(e),children:"Save Changes"}),(0,a.jsx)(p.Z,{onClick:()=>(0,u.jE)(l,e.name),className:"mx-2",children:"Test Callback"})]})]},s)})})]})})}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(F.Z,{children:[(0,a.jsxs)(_.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)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{}),(0,a.jsx)(B.Z,{}),(0,a.jsx)(B.Z,{children:"Slack Webhook URL"})]})}),(0,a.jsx)(U.Z,{children:Object.entries(z).map((e,l)=>{let[s,t]=e;return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:"region_outage_alerts"==s?n?(0,a.jsx)(eM.Z,{id:"switch",name:"switch",checked:V(s),onChange:()=>M(s)}):(0,a.jsx)(p.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)(eM.Z,{id:"switch",name:"switch",checked:V(s),onChange:()=>M(s)})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(_.Z,{children:t})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(j.Z,{name:s,type:"password",defaultValue:C&&C[s]?C[s]:A})})]},l)})})]}),(0,a.jsx)(p.Z,{size:"xs",className:"mt-2",onClick:()=>{if(!l)return;let e={};Object.entries(z).forEach(l=>{let[s,t]=l,n=document.querySelector('input[name="'.concat(s,'"]'));console.log("key",s),console.log("webhookInput",n);let a=(null==n?void 0:n.value)||"";console.log("newWebhookValue",a),e[s]=a}),console.log("updatedAlertToWebhooks",e);let s={general_settings:{alert_to_webhook_url:e,alert_types:T}};console.log("payload",s);try{(0,u.K_)(l,s)}catch(e){k.ZP.error("Failed to update alerts: "+e,20)}k.ZP.success("Alerts updated successfully")},children:"Save Changes"}),(0,a.jsx)(p.Z,{onClick:()=>(0,u.jE)(l,"slack"),className:"mx-2",children:"Test Alerts"})]})}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eD,{accessToken:l,premiumUser:n})}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Email Settings"}),(0,a.jsxs)(_.Z,{children:[(0,a.jsx)("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:d.filter(e=>"email"===e.name).map((e,l)=>{var s;return(0,a.jsx)(D.Z,{children:(0,a.jsx)("ul",{children:(0,a.jsx)(x.Z,{numItems:2,children:Object.entries(null!==(s=e.variables)&&void 0!==s?s:{}).map(e=>{let[l,s]=e;return(0,a.jsxs)("li",{className:"mx-2 my-2",children:[!0!=n&&("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)(_.Z,{className:"mt-2",children:[" ","✨ ",l]})}),(0,a.jsx)(j.Z,{name:l,defaultValue:s,type:"password",disabled:!0,style:{width:"400px"}})]}):(0,a.jsxs)("div",{children:[(0,a.jsx)(_.Z,{className:"mt-2",children:l}),(0,a.jsx)(j.Z,{name:l,defaultValue:s,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)(p.Z,{className:"mt-2",onClick:()=>G(),children:"Save Changes"}),(0,a.jsx)(p.Z,{onClick:()=>(0,u.jE)(l,"email"),className:"mx-2",children:"Test Email Alerts"})]})})]})]})]}),(0,a.jsx)(w.Z,{title:"Add Callback",visible:m,onOk:H,width:800,onCancel:()=>{h(!1),g.resetFields(),f(null)},footer:null,children:(0,a.jsxs)(S.Z,{form:g,layout:"vertical",onFinish:H,children:[(0,a.jsx)(S.Z.Item,{label:"Callback",name:"callback",rules:[{required:!0,message:"Please select a callback"}],children:(0,a.jsxs)(v.default,{onChange:e=>{f(e)},children:[(0,a.jsx)(v.default.Option,{value:"langfuse",children:"langfuse"}),(0,a.jsx)(v.default.Option,{value:"openmeter",children:"openmeter"})]})}),"langfuse"===Z&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"LANGFUSE_PUBLIC_KEY",name:"langfusePublicKey",rules:[{required:!0,message:"Please enter the public key"}],children:(0,a.jsx)(j.Z,{type:"password"})}),(0,a.jsx)(S.Z.Item,{label:"LANGFUSE_PRIVATE_KEY",name:"langfusePrivateKey",rules:[{required:!0,message:"Please enter the private key"}],children:(0,a.jsx)(j.Z,{type:"password"})})]}),"openmeter"==Z&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(S.Z.Item,{label:"OPENMETER_API_KEY",name:"openMeterApiKey",rules:[{required:!0,message:"Please enter the openmeter api key"}],children:(0,a.jsx)(j.Z,{type:"password"})})}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Save"})})]})})]})):null};let{Option:eq}=v.default;var ez=e=>{let{models:l,accessToken:s,routerSettings:t,setRouterSettings:n}=e,[i]=S.Z.useForm(),[o,d]=(0,r.useState)(!1),[c,m]=(0,r.useState)("");return(0,a.jsxs)("div",{children:[(0,a.jsx)(p.Z,{className:"mx-auto",onClick:()=>d(!0),children:"+ Add Fallbacks"}),(0,a.jsx)(w.Z,{title:"Add Fallbacks",visible:o,width:800,footer:null,onOk:()=>{d(!1),i.resetFields()},onCancel:()=>{d(!1),i.resetFields()},children:(0,a.jsxs)(S.Z,{form:i,onFinish:e=>{console.log(e);let{model_name:l,models:a}=e,r=[...t.fallbacks||[],{[l]:a}],o={...t,fallbacks:r};console.log(o);try{(0,u.K_)(s,{router_settings:o}),n(o)}catch(e){k.ZP.error("Failed to update router settings: "+e,20)}k.ZP.success("router settings updated successfully"),d(!1),i.resetFields()},labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Public Model Name",name:"model_name",rules:[{required:!0,message:"Set the model to fallback for"}],help:"required",children:(0,a.jsx)(z.Z,{defaultValue:c,children:l&&l.map((e,l)=>(0,a.jsx)(V.Z,{value:e,onClick:()=>m(e),children:e},l))})}),(0,a.jsx)(S.Z.Item,{label:"Fallback Models",name:"models",rules:[{required:!0,message:"Please select a model"}],help:"required",children:(0,a.jsx)(eo.Z,{value:l,children:l&&l.filter(e=>e!=c).map(e=>(0,a.jsx)(ed.Z,{value:e,children:e},e))})})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Add Fallbacks"})})]})})]})},eV=s(12968);async function eG(e,l){console.log("isLocal:",!1);let s=window.location.origin,t=new eV.ZP.OpenAI({apiKey:l,baseURL:s,dangerouslyAllowBrowser:!0});try{let l=await t.chat.completions.create({model:e,messages:[{role:"user",content:"Hi, this is a test message"}],mock_testing_fallbacks:!0});k.ZP.success((0,a.jsxs)("span",{children:["Test model=",(0,a.jsx)("strong",{children:e}),", received model=",(0,a.jsx)("strong",{children:l.model}),". See"," ",(0,a.jsx)("a",{href:"#",onClick:()=>window.open("https://docs.litellm.ai/docs/proxy/reliability","_blank"),style:{textDecoration:"underline",color:"blue"},children:"curl"})]}))}catch(e){k.ZP.error("Error occurred while generating model response. Please try again. Error: ".concat(e),20)}}let eW={ttl:3600,lowest_latency_buffer:0},eH=e=>{let{selectedStrategy:l,strategyArgs:s,paramExplanation:t}=e;return(0,a.jsxs)(g.Z,{children:[(0,a.jsx)(f.Z,{className:"text-sm font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Routing Strategy Specific Args"}),(0,a.jsx)(Z.Z,{children:"latency-based-routing"==l?(0,a.jsx)(F.Z,{children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Setting"}),(0,a.jsx)(B.Z,{children:"Value"})]})}),(0,a.jsx)(U.Z,{children:Object.entries(s).map(e=>{let[l,s]=e;return(0,a.jsxs)(q.Z,{children:[(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(_.Z,{children:l}),(0,a.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:t[l]})]}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(j.Z,{name:l,defaultValue:"object"==typeof s?JSON.stringify(s,null,2):s.toString()})})]},l)})})]})}):(0,a.jsx)(_.Z,{children:"No specific settings"})})]})};var eY=e=>{let{accessToken:l,userRole:s,userID:t,modelData:n}=e,[i,o]=(0,r.useState)({}),[d,c]=(0,r.useState)({}),[m,g]=(0,r.useState)([]),[Z,f]=(0,r.useState)(!1),[b]=S.Z.useForm(),[v,w]=(0,r.useState)(null),[N,I]=(0,r.useState)(null),[E,C]=(0,r.useState)(null),P={routing_strategy_args:"(dict) Arguments to pass to the routing strategy",routing_strategy:"(string) Routing strategy to use",allowed_fails:"(int) Number of times a deployment can fail before being added to cooldown",cooldown_time:"(int) time in seconds to cooldown a deployment after failure",num_retries:"(int) Number of retries for failed requests. Defaults to 0.",timeout:"(float) Timeout for requests. Defaults to None.",retry_after:"(int) Minimum time to wait before retrying a failed request",ttl:"(int) Sliding window to look back over when calculating the average latency of a deployment. Default - 1 hour (in seconds).",lowest_latency_buffer:"(float) Shuffle between deployments within this % of the lowest latency. Default - 0 (i.e. always pick lowest latency)."};(0,r.useEffect)(()=>{l&&s&&t&&((0,u.BL)(l,t,s).then(e=>{console.log("callbacks",e),o(e.router_settings)}),(0,u.YU)(l).then(e=>{g(e)}))},[l,s,t]);let T=async e=>{if(l){console.log("received key: ".concat(e)),console.log("routerSettings['fallbacks']: ".concat(i.fallbacks)),i.fallbacks.map(l=>(e in l&&delete l[e],l));try{await (0,u.K_)(l,{router_settings:i}),o({...i}),I(i.routing_strategy),k.ZP.success("Router settings updated successfully")}catch(e){k.ZP.error("Failed to update router settings: "+e,20)}}},G=(e,l)=>{g(m.map(s=>s.field_name===e?{...s,field_value:l}:s))},W=(e,s)=>{if(!l)return;let t=m[s].field_value;if(null!=t&&void 0!=t)try{(0,u.jA)(l,e,t);let s=m.map(l=>l.field_name===e?{...l,stored_in_db:!0}:l);g(s)}catch(e){}},H=(e,s)=>{if(l)try{(0,u.ao)(l,e);let s=m.map(l=>l.field_name===e?{...l,stored_in_db:null,field_value:null}:l);g(s)}catch(e){}},Y=e=>{if(!l)return;console.log("router_settings",e);let s=Object.fromEntries(Object.entries(e).map(e=>{let[l,s]=e;if("routing_strategy_args"!==l&&"routing_strategy"!==l){var t;return[l,(null===(t=document.querySelector('input[name="'.concat(l,'"]')))||void 0===t?void 0:t.value)||s]}if("routing_strategy"==l)return[l,N];if("routing_strategy_args"==l&&"latency-based-routing"==N){let e={},l=document.querySelector('input[name="lowest_latency_buffer"]'),s=document.querySelector('input[name="ttl"]');return(null==l?void 0:l.value)&&(e.lowest_latency_buffer=Number(l.value)),(null==s?void 0:s.value)&&(e.ttl=Number(s.value)),console.log("setRoutingStrategyArgs: ".concat(e)),["routing_strategy_args",e]}return null}).filter(e=>null!=e));console.log("updatedVariables",s);try{(0,u.K_)(l,{router_settings:s})}catch(e){k.ZP.error("Failed to update router settings: "+e,20)}k.ZP.success("router settings updated successfully")};return l?(0,a.jsx)("div",{className:"w-full mx-4",children:(0,a.jsxs)(en.Z,{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,a.jsxs)(ea.Z,{variant:"line",defaultValue:"1",children:[(0,a.jsx)(et.Z,{value:"1",children:"Loadbalancing"}),(0,a.jsx)(et.Z,{value:"2",children:"Fallbacks"}),(0,a.jsx)(et.Z,{value:"3",children:"General"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:[(0,a.jsx)(y.Z,{children:"Router Settings"}),(0,a.jsxs)(F.Z,{children:[(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Setting"}),(0,a.jsx)(B.Z,{children:"Value"})]})}),(0,a.jsx)(U.Z,{children:Object.entries(i).filter(e=>{let[l,s]=e;return"fallbacks"!=l&&"context_window_fallbacks"!=l&&"routing_strategy_args"!=l}).map(e=>{let[l,s]=e;return(0,a.jsxs)(q.Z,{children:[(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(_.Z,{children:l}),(0,a.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:P[l]})]}),(0,a.jsx)(D.Z,{children:"routing_strategy"==l?(0,a.jsxs)(z.Z,{defaultValue:s,className:"w-full max-w-md",onValueChange:I,children:[(0,a.jsx)(V.Z,{value:"usage-based-routing",children:"usage-based-routing"}),(0,a.jsx)(V.Z,{value:"latency-based-routing",children:"latency-based-routing"}),(0,a.jsx)(V.Z,{value:"simple-shuffle",children:"simple-shuffle"})]}):(0,a.jsx)(j.Z,{name:l,defaultValue:"object"==typeof s?JSON.stringify(s,null,2):s.toString()})})]},l)})})]}),(0,a.jsx)(eH,{selectedStrategy:N,strategyArgs:i&&i.routing_strategy_args&&Object.keys(i.routing_strategy_args).length>0?i.routing_strategy_args:eW,paramExplanation:P})]}),(0,a.jsx)(h.Z,{children:(0,a.jsx)(p.Z,{className:"mt-2",onClick:()=>Y(i),children:"Save Changes"})})]})}),(0,a.jsxs)(er.Z,{children:[(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Model Name"}),(0,a.jsx)(B.Z,{children:"Fallbacks"})]})}),(0,a.jsx)(U.Z,{children:i.fallbacks&&i.fallbacks.map((e,s)=>Object.entries(e).map(e=>{let[t,n]=e;return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:t}),(0,a.jsx)(D.Z,{children:Array.isArray(n)?n.join(", "):n}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(p.Z,{onClick:()=>eG(t,l),children:"Test Fallback"})}),(0,a.jsx)(D.Z,{children:(0,a.jsx)(M.Z,{icon:O.Z,size:"sm",onClick:()=>T(t)})})]},s.toString()+t)}))})]}),(0,a.jsx)(ez,{models:(null==n?void 0:n.data)?n.data.map(e=>e.model_name):[],accessToken:l,routerSettings:i,setRouterSettings:o})]}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(F.Z,{children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Setting"}),(0,a.jsx)(B.Z,{children:"Value"}),(0,a.jsx)(B.Z,{children:"Status"}),(0,a.jsx)(B.Z,{children:"Action"})]})}),(0,a.jsx)(U.Z,{children:m.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(_.Z,{children:e.field_name}),(0,a.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:e.field_description})]}),(0,a.jsx)(D.Z,{children:"Integer"==e.field_type?(0,a.jsx)(A.Z,{step:1,value:e.field_value,onChange:l=>G(e.field_name,l)}):null}),(0,a.jsx)(D.Z,{children:!0==e.stored_in_db?(0,a.jsx)(R.Z,{icon:eL.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,a.jsx)(R.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,a.jsx)(R.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,a.jsxs)(D.Z,{children:[(0,a.jsx)(p.Z,{onClick:()=>W(e.field_name,l),children:"Update"}),(0,a.jsx)(M.Z,{icon:O.Z,color:"red",onClick:()=>H(e.field_name,l),children:"Reset"})]})]},l))})]})})})]})]})}):null},eJ=e=>{let{isModalVisible:l,accessToken:s,setIsModalVisible:t,setBudgetList:n}=e,[r]=S.Z.useForm(),i=async e=>{if(null!=s&&void 0!=s)try{k.ZP.info("Making API Call");let l=await (0,u.Zr)(s,e);console.log("key create Response:",l),n(e=>e?[...e,l]:[l]),k.ZP.success("API Key Created"),r.resetFields()}catch(e){console.error("Error creating the key:",e),k.ZP.error("Error creating the key: ".concat(e),20)}};return(0,a.jsx)(w.Z,{title:"Create Budget",visible:l,width:800,footer:null,onOk:()=>{t(!1),r.resetFields()},onCancel:()=>{t(!1),r.resetFields()},children:(0,a.jsxs)(S.Z,{form:r,onFinish:i,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z.Item,{label:"Budget ID",name:"budget_id",rules:[{required:!0,message:"Please input a human-friendly name for the budget"}],help:"A human-friendly name for the budget",children:(0,a.jsx)(j.Z,{placeholder:""})}),(0,a.jsx)(S.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,a.jsx)(A.Z,{step:1,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,a.jsx)(A.Z,{step:1,precision:2,width:200})}),(0,a.jsxs)(g.Z,{className:"mt-20 mb-8",children:[(0,a.jsx)(f.Z,{children:(0,a.jsx)("b",{children:"Optional Settings"})}),(0,a.jsxs)(Z.Z,{children:[(0,a.jsx)(S.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(A.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(S.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,a.jsxs)(v.default,{defaultValue:null,placeholder:"n/a",children:[(0,a.jsx)(v.default.Option,{value:"24h",children:"daily"}),(0,a.jsx)(v.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(I.ZP,{htmlType:"submit",children:"Create Budget"})})]})})},e$=e=>{let{accessToken:l}=e,[s,t]=(0,r.useState)(!1),[n,i]=(0,r.useState)([]);(0,r.useEffect)(()=>{l&&(0,u.O3)(l).then(e=>{i(e)})},[l]);let o=async(e,s)=>{if(null==l)return;k.ZP.info("Request made"),await (0,u.NV)(l,e);let t=[...n];t.splice(s,1),i(t),k.ZP.success("Budget Deleted.")};return(0,a.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,a.jsx)(p.Z,{size:"sm",variant:"primary",className:"mb-2",onClick:()=>t(!0),children:"+ Create Budget"}),(0,a.jsx)(eJ,{accessToken:l,isModalVisible:s,setIsModalVisible:t,setBudgetList:i}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(_.Z,{children:"Create a budget to assign to customers."}),(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Budget ID"}),(0,a.jsx)(B.Z,{children:"Max Budget"}),(0,a.jsx)(B.Z,{children:"TPM"}),(0,a.jsx)(B.Z,{children:"RPM"})]})}),(0,a.jsx)(U.Z,{children:n.map((e,l)=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.budget_id}),(0,a.jsx)(D.Z,{children:e.max_budget?e.max_budget:"n/a"}),(0,a.jsx)(D.Z,{children:e.tpm_limit?e.tpm_limit:"n/a"}),(0,a.jsx)(D.Z,{children:e.rpm_limit?e.rpm_limit:"n/a"}),(0,a.jsx)(M.Z,{icon:O.Z,size:"sm",onClick:()=>o(e.budget_id,l)})]},l))})]})]}),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)(_.Z,{className:"text-base",children:"How to use budget id"}),(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{children:[(0,a.jsx)(et.Z,{children:"Assign Budget to Customer"}),(0,a.jsx)(et.Z,{children:"Test it (Curl)"}),(0,a.jsx)(et.Z,{children:"Test it (OpenAI SDK)"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"bash",children:"\ncurl -X POST --location '/end_user/new' \n-H 'Authorization: Bearer ' \n-H 'Content-Type: application/json' \n-d '{\"user_id\": \"my-customer-id', \"budget_id\": \"\"}' # \uD83D\uDC48 KEY CHANGE\n\n "})}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"bash",children:'\ncurl -X POST --location \'/chat/completions\' \n-H \'Authorization: Bearer \' \n-H \'Content-Type: application/json\' \n-d \'{\n "model": "gpt-3.5-turbo\', \n "messages":[{"role": "user", "content": "Hey, how\'s it going?"}],\n "user": "my-customer-id"\n}\' # \uD83D\uDC48 KEY CHANGE\n\n '})}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"python",children:'from openai import OpenAI\nclient = OpenAI(\n base_url="{let{}=e;return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(x.Z,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,a.jsxs)("div",{className:"mb-5",children:[(0,a.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:"OpenAI Compatible Proxy: API Reference"}),(0,a.jsx)(_.Z,{className:"mt-2 mb-2",children:"LiteLLM is OpenAI Compatible. This means your API Key works with the OpenAI SDK. Just replace the base_url to point to your litellm proxy. Example Below "}),(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{children:[(0,a.jsx)(et.Z,{children:"OpenAI Python SDK"}),(0,a.jsx)(et.Z,{children:"LlamaIndex"}),(0,a.jsx)(et.Z,{children:"Langchain Py"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"python",children:'\nimport openai\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="http://0.0.0.0:4000" # LiteLLM Proxy is OpenAI compatible, Read More: https://docs.litellm.ai/docs/proxy/user_keys\n)\n\nresponse = client.chat.completions.create(\n model="gpt-3.5-turbo", # model to send to the proxy\n messages = [\n {\n "role": "user",\n "content": "this is a test request, write a short poem"\n }\n ]\n)\n\nprint(response)\n '})}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"python",children:'\nimport os, dotenv\n\nfrom llama_index.llms import AzureOpenAI\nfrom llama_index.embeddings import AzureOpenAIEmbedding\nfrom llama_index import VectorStoreIndex, SimpleDirectoryReader, ServiceContext\n\nllm = AzureOpenAI(\n engine="azure-gpt-3.5", # model_name on litellm proxy\n temperature=0.0,\n azure_endpoint="http://0.0.0.0:4000", # litellm proxy endpoint\n api_key="sk-1234", # litellm proxy API Key\n api_version="2023-07-01-preview",\n)\n\nembed_model = AzureOpenAIEmbedding(\n deployment_name="azure-embedding-model",\n azure_endpoint="http://0.0.0.0:4000",\n api_key="sk-1234",\n api_version="2023-07-01-preview",\n)\n\n\ndocuments = SimpleDirectoryReader("llama_index_data").load_data()\nservice_context = ServiceContext.from_defaults(llm=llm, embed_model=embed_model)\nindex = VectorStoreIndex.from_documents(documents, service_context=service_context)\n\nquery_engine = index.as_query_engine()\nresponse = query_engine.query("What did the author do growing up?")\nprint(response)\n\n '})}),(0,a.jsx)(er.Z,{children:(0,a.jsx)(eS.Z,{language:"python",children:'\nfrom langchain.chat_models import ChatOpenAI\nfrom langchain.prompts.chat import (\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n SystemMessagePromptTemplate,\n)\nfrom langchain.schema import HumanMessage, SystemMessage\n\nchat = ChatOpenAI(\n openai_api_base="http://0.0.0.0:4000",\n model = "gpt-3.5-turbo",\n temperature=0.1\n)\n\nmessages = [\n SystemMessage(\n content="You are a helpful assistant that im using to make a test request to."\n ),\n HumanMessage(\n content="test from litellm. tell me why it\'s amazing in 1 sentence"\n ),\n]\nresponse = chat(messages)\n\nprint(response)\n\n '})})]})]})]})})})};async function e0(e,l,s,t){console.log("isLocal:",!1);let n=window.location.origin,a=new eV.ZP.OpenAI({apiKey:t,baseURL:n,dangerouslyAllowBrowser:!0});try{for await(let t of(await a.chat.completions.create({model:s,stream:!0,messages:[{role:"user",content:e}]})))console.log(t),t.choices[0].delta.content&&l(t.choices[0].delta.content)}catch(e){k.ZP.error("Error occurred while generating model response. Please try again. Error: ".concat(e),20)}}var e1=e=>{let{accessToken:l,token:s,userRole:t,userID:n}=e,[i,o]=(0,r.useState)(""),[d,c]=(0,r.useState)(""),[m,g]=(0,r.useState)([]),[Z,f]=(0,r.useState)(void 0),[y,b]=(0,r.useState)([]);(0,r.useEffect)(()=>{l&&s&&t&&n&&(async()=>{try{let e=await (0,u.So)(l,n,t);if(console.log("model_info:",e),(null==e?void 0:e.data.length)>0){let l=e.data.map(e=>({value:e.id,label:e.id}));console.log(l),b(l),f(e.data[0].id)}}catch(e){console.error("Error fetching model info:",e)}})()},[l,n,t]);let S=(e,l)=>{g(s=>{let t=s[s.length-1];return t&&t.role===e?[...s.slice(0,s.length-1),{role:e,content:t.content+l}]:[...s,{role:e,content:l}]})},k=async()=>{if(""!==d.trim()&&i&&s&&t&&n){g(e=>[...e,{role:"user",content:d}]);try{Z&&await e0(d,e=>S("assistant",e),Z,i)}catch(e){console.error("Error fetching model response",e),S("assistant","Error fetching model response")}c("")}};if(t&&"Admin Viewer"==t){let{Title:e,Paragraph:l}=ee.default;return(0,a.jsxs)("div",{children:[(0,a.jsx)(e,{level:1,children:"Access Denied"}),(0,a.jsx)(l,{children:"Ask your proxy admin for access to test models"})]})}return(0,a.jsx)("div",{style:{width:"100%",position:"relative"},children:(0,a.jsx)(x.Z,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,a.jsx)(F.Z,{children:(0,a.jsxs)(en.Z,{children:[(0,a.jsx)(ea.Z,{children:(0,a.jsx)(et.Z,{children:"Chat"})}),(0,a.jsx)(ei.Z,{children:(0,a.jsxs)(er.Z,{children:[(0,a.jsx)("div",{className:"sm:max-w-2xl",children:(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(_.Z,{children:"API Key"}),(0,a.jsx)(j.Z,{placeholder:"Type API Key here",type:"password",onValueChange:o,value:i})]}),(0,a.jsxs)(h.Z,{className:"mx-2",children:[(0,a.jsx)(_.Z,{children:"Select Model:"}),(0,a.jsx)(v.default,{placeholder:"Select a Model",onChange:e=>{console.log("selected ".concat(e)),f(e)},options:y,style:{width:"200px"}})]})]})}),(0,a.jsxs)(L.Z,{className:"mt-5",style:{display:"block",maxHeight:"60vh",overflowY:"auto"},children:[(0,a.jsx)(K.Z,{children:(0,a.jsx)(q.Z,{children:(0,a.jsx)(D.Z,{})})}),(0,a.jsx)(U.Z,{children:m.map((e,l)=>(0,a.jsx)(q.Z,{children:(0,a.jsx)(D.Z,{children:"".concat(e.role,": ").concat(e.content)})},l))})]}),(0,a.jsx)("div",{className:"mt-3",style:{position:"absolute",bottom:5,width:"95%"},children:(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)(j.Z,{type:"text",value:d,onChange:e=>c(e.target.value),placeholder:"Type your message..."}),(0,a.jsx)(p.Z,{onClick:k,className:"ml-2",children:"Send"})]})})]})})]})})})})},e2=s(33509),e4=s(95781);let{Sider:e5}=e2.default;var e8=e=>{let{setPage:l,userRole:s,defaultSelectedKey:t}=e;return"Admin Viewer"==s?(0,a.jsx)(e2.default,{style:{minHeight:"100vh",maxWidth:"120px"},children:(0,a.jsx)(e5,{width:120,children:(0,a.jsxs)(e4.Z,{mode:"inline",defaultSelectedKeys:t||["4"],style:{height:"100%",borderRight:0},children:[(0,a.jsx)(e4.Z.Item,{onClick:()=>l("api-keys"),children:"API Keys"},"4"),(0,a.jsx)(e4.Z.Item,{onClick:()=>l("models"),children:"Models"},"2"),(0,a.jsx)(e4.Z.Item,{onClick:()=>l("llm-playground"),children:"Chat UI"},"3"),(0,a.jsx)(e4.Z.Item,{onClick:()=>l("usage"),children:"Usage"},"1")]})})}):(0,a.jsx)(e2.default,{style:{minHeight:"100vh",maxWidth:"145px"},children:(0,a.jsx)(e5,{width:145,children:(0,a.jsxs)(e4.Z,{mode:"inline",defaultSelectedKeys:t||["1"],style:{height:"100%",borderRight:0},children:[(0,a.jsx)(e4.Z.Item,{onClick:()=>l("api-keys"),children:(0,a.jsx)(_.Z,{children:"API Keys"})},"1"),(0,a.jsx)(e4.Z.Item,{onClick:()=>l("llm-playground"),children:(0,a.jsx)(_.Z,{children:"Test Key"})},"3"),"Admin"==s?(0,a.jsx)(e4.Z.Item,{onClick:()=>l("models"),children:(0,a.jsx)(_.Z,{children:"Models"})},"2"):null,"Admin"==s?(0,a.jsx)(e4.Z.Item,{onClick:()=>l("usage"),children:(0,a.jsx)(_.Z,{children:"Usage"})},"4"):null,"Admin"==s?(0,a.jsx)(e4.Z.Item,{onClick:()=>l("teams"),children:(0,a.jsx)(_.Z,{children:"Teams"})},"6"):null,"Admin"==s?(0,a.jsx)(e4.Z.Item,{onClick:()=>l("users"),children:(0,a.jsx)(_.Z,{children:"Internal Users"})},"5"):null,"Admin"==s?(0,a.jsx)(e4.Z.Item,{onClick:()=>l("settings"),children:(0,a.jsx)(_.Z,{children:"Logging & Alerts"})},"8"):null,"Admin"==s?(0,a.jsx)(e4.Z.Item,{onClick:()=>l("budgets"),children:(0,a.jsx)(_.Z,{children:"Budgets"})},"9"):null,"Admin"==s?(0,a.jsx)(e4.Z.Item,{onClick:()=>l("general-settings"),children:(0,a.jsx)(_.Z,{children:"Router Settings"})},"10"):null,"Admin"==s?(0,a.jsx)(e4.Z.Item,{onClick:()=>l("admin-panel"),children:(0,a.jsx)(_.Z,{children:"Admin"})},"11"):null,(0,a.jsx)(e4.Z.Item,{onClick:()=>l("api_ref"),children:(0,a.jsx)(_.Z,{children:"API Reference"})},"12"),(0,a.jsx)(e4.Z.Item,{onClick:()=>l("model-hub"),children:(0,a.jsx)(_.Z,{children:"Model Hub"})},"14")]})})})},e3=s(67989),e6=s(49167),e7=s(52703),e9=e=>{let{accessToken:l,token:s,userRole:t,userID:n,keys:i,premiumUser:o}=e,d=new Date,[c,m]=(0,r.useState)([]),[j,g]=(0,r.useState)([]),[Z,f]=(0,r.useState)([]),[b,v]=(0,r.useState)([]),[S,k]=(0,r.useState)([]),[w,N]=(0,r.useState)([]),[A,I]=(0,r.useState)([]),[E,C]=(0,r.useState)([]),[P,T]=(0,r.useState)([]),[O,R]=(0,r.useState)({}),[M,G]=(0,r.useState)([]),[W,H]=(0,r.useState)(""),[Y,$]=(0,r.useState)({from:new Date(Date.now()-6048e5),to:new Date}),X=new Date(d.getFullYear(),d.getMonth(),1),Q=new Date(d.getFullYear(),d.getMonth()+1,0),ee=eh(X),el=eh(Q);function eo(e){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0,notation:"compact",compactDisplay:"short"}).format(e)}console.log("keys in usage",i),console.log("premium user in usage",o);let ed=async(e,s,t)=>{if(!e||!s||!l)return;s.setHours(23,59,59,999),e.setHours(0,0,0,0),console.log("uiSelectedKey",t);let n=await (0,u.b1)(l,t,e.toISOString(),s.toISOString());console.log("End user data updated successfully",n),v(n)},eu=async(e,s)=>{e&&s&&l&&(s.setHours(23,59,59,999),e.setHours(0,0,0,0),N((await (0,u.J$)(l,e.toISOString(),s.toISOString())).spend_per_tag),console.log("Tag spend data updated successfully"))};function eh(e){let l=e.getFullYear(),s=e.getMonth()+1,t=e.getDate();return"".concat(l,"-").concat(s<10?"0"+s:s,"-").concat(t<10?"0"+t:t)}return console.log("Start date is ".concat(ee)),console.log("End date is ".concat(el)),(0,r.useEffect)(()=>{l&&s&&t&&n&&(async()=>{try{if(console.log("user role: ".concat(t)),"Admin"==t||"Admin Viewer"==t){var e,a;let t=await (0,u.FC)(l);m(t);let n=await (0,u.OU)(l,s,ee,el);console.log("provider_spend",n),T(n);let r=(await (0,u.tN)(l)).map(e=>({key:(e.key_alias||e.key_name||e.api_key).substring(0,10),spend:e.total_spend}));g(r);let i=(await (0,u.Au)(l)).map(e=>({key:e.model,spend:e.total_spend}));f(i);let o=await (0,u.mR)(l);console.log("teamSpend",o),k(o.daily_spend),I(o.teams);let d=o.total_spend_per_team;d=d.map(e=>(e.name=e.team_id||"",e.value=e.total_spend||0,e.value=e.value.toFixed(2),e)),C(d);let c=await (0,u.J$)(l,null===(e=Y.from)||void 0===e?void 0:e.toISOString(),null===(a=Y.to)||void 0===a?void 0:a.toISOString());N(c.spend_per_tag);let h=await (0,u.b1)(l,null,void 0,void 0);v(h),console.log("spend/user result",h);let x=await (0,u.wd)(l,ee,el);R(x);let p=await (0,u.xA)(l,ee,el);console.log("global activity per model",p),G(p)}else"App Owner"==t&&await (0,u.HK)(l,s,t,n,ee,el).then(async e=>{if(console.log("result from spend logs call",e),"daily_spend"in e){let l=e.daily_spend;console.log("daily spend",l),m(l);let s=e.top_api_keys;g(s)}else{let s=(await (0,u.e2)(l,function(e){let l=[];e.forEach(e=>{Object.entries(e).forEach(e=>{let[s,t]=e;"spend"!==s&&"startTime"!==s&&"models"!==s&&"users"!==s&&l.push({key:s,spend:t})})}),l.sort((e,l)=>Number(l.spend)-Number(e.spend));let s=l.slice(0,5).map(e=>e.key);return console.log("topKeys: ".concat(Object.keys(s[0]))),s}(e))).info.map(e=>({key:(e.key_name||e.key_alias).substring(0,10),spend:e.spend}));g(s),m(e)}})}catch(e){console.error("There was an error fetching the data",e)}})()},[l,s,t,n,ee,el]),(0,a.jsxs)("div",{style:{width:"100%"},className:"p-8",children:[(0,a.jsx)(J,{userID:n,userRole:t,accessToken:l,userSpend:null,selectedTeam:null}),(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{className:"mt-2",children:[(0,a.jsx)(et.Z,{children:"All Up"}),(0,a.jsx)(et.Z,{children:"Team Based Usage"}),(0,a.jsx)(et.Z,{children:"End User Usage"}),(0,a.jsx)(et.Z,{children:"Tag Based Usage"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsxs)(en.Z,{children:[(0,a.jsxs)(ea.Z,{variant:"solid",className:"mt-1",children:[(0,a.jsx)(et.Z,{children:"Cost"}),(0,a.jsx)(et.Z,{children:"Activity"})]}),(0,a.jsxs)(ei.Z,{children:[(0,a.jsx)(er.Z,{children:(0,a.jsxs)(x.Z,{numItems:2,className:"gap-2 h-[100vh] w-full",children:[(0,a.jsx)(h.Z,{numColSpan:2,children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Monthly Spend"}),(0,a.jsx)(em.Z,{data:c,index:"date",categories:["spend"],colors:["blue"],valueFormatter:e=>"$ ".concat(new Intl.NumberFormat("us").format(e).toString()),yAxisWidth:100,tickGap:5})]})}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Top API Keys"}),(0,a.jsx)(em.Z,{className:"mt-4 h-40",data:j,index:"key",categories:["spend"],colors:["blue"],yAxisWidth:80,tickGap:5,layout:"vertical",showXAxis:!1,showLegend:!1})]})}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Top Models"}),(0,a.jsx)(em.Z,{className:"mt-4 h-40",data:Z,index:"key",categories:["spend"],colors:["blue"],yAxisWidth:200,layout:"vertical",showXAxis:!1,showLegend:!1})]})}),(0,a.jsx)(h.Z,{numColSpan:1}),(0,a.jsx)(h.Z,{numColSpan:2,children:(0,a.jsxs)(F.Z,{className:"mb-2",children:[(0,a.jsx)(y.Z,{children:"✨ Spend by Provider"}),o?(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsx)(e7.Z,{className:"mt-4 h-40",variant:"pie",data:P,index:"provider",category:"spend"})}),(0,a.jsx)(h.Z,{numColSpan:1,children:(0,a.jsxs)(L.Z,{children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"Provider"}),(0,a.jsx)(B.Z,{children:"Spend"})]})}),(0,a.jsx)(U.Z,{children:P.map(e=>(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.provider}),(0,a.jsx)(D.Z,{children:1e-5>parseFloat(e.spend.toFixed(2))?"less than 0.00":e.spend.toFixed(2)})]},e.provider))})]})})]})}):(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to use this feature"}),(0,a.jsx)(p.Z,{variant:"primary",className:"mb-2",children:(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})})]})]})})]})}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(x.Z,{numItems:1,className:"gap-2 h-[75vh] w-full",children:[(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"All Up"}),(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e6.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",eo(O.sum_api_requests)]}),(0,a.jsx)(ec.Z,{className:"h-40",data:O.daily_data,valueFormatter:eo,index:"date",colors:["cyan"],categories:["api_requests"],onValueChange:e=>console.log(e)})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e6.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",eo(O.sum_total_tokens)]}),(0,a.jsx)(em.Z,{className:"h-40",data:O.daily_data,valueFormatter:eo,index:"date",colors:["cyan"],categories:["total_tokens"],onValueChange:e=>console.log(e)})]})]})]}),o?(0,a.jsx)(a.Fragment,{children:M.map((e,l)=>(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:e.model}),(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e6.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",eo(e.sum_api_requests)]}),(0,a.jsx)(ec.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["api_requests"],valueFormatter:eo,onValueChange:e=>console.log(e)})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e6.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",eo(e.sum_total_tokens)]}),(0,a.jsx)(em.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["total_tokens"],valueFormatter:eo,onValueChange:e=>console.log(e)})]})]})]},l))}):(0,a.jsx)(a.Fragment,{children:M&&M.length>0&&M.slice(0,1).map((e,l)=>(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"✨ Activity by Model"}),(0,a.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to see analytics for all models"}),(0,a.jsx)(p.Z,{variant:"primary",className:"mb-2",children:(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:e.model}),(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e6.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",eo(e.sum_api_requests)]}),(0,a.jsx)(ec.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["api_requests"],valueFormatter:eo,onValueChange:e=>console.log(e)})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(e6.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",eo(e.sum_total_tokens)]}),(0,a.jsx)(em.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],valueFormatter:eo,categories:["total_tokens"],onValueChange:e=>console.log(e)})]})]})]})]},l))})]})})]})]})}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(x.Z,{numItems:2,className:"gap-2 h-[75vh] w-full",children:[(0,a.jsxs)(h.Z,{numColSpan:2,children:[(0,a.jsxs)(F.Z,{className:"mb-2",children:[(0,a.jsx)(y.Z,{children:"Total Spend Per Team"}),(0,a.jsx)(e3.Z,{data:E})]}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Daily Spend Per Team"}),(0,a.jsx)(em.Z,{className:"h-72",data:S,showLegend:!0,index:"date",categories:A,yAxisWidth:80,colors:["blue","green","yellow","red","purple"],stack:!0})]})]}),(0,a.jsx)(h.Z,{numColSpan:2})]})}),(0,a.jsxs)(er.Z,{children:[(0,a.jsxs)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:["End-Users of your LLM API calls. Tracked when a `user` param is passed in your LLM calls ",(0,a.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/users",target:"_blank",children:"docs here"})]}),(0,a.jsxs)(x.Z,{numItems:2,children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(_.Z,{children:"Select Time Range"}),(0,a.jsx)(es.Z,{enableSelect:!0,value:Y,onValueChange:e=>{$(e),ed(e.from,e.to,null)}})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(_.Z,{children:"Select Key"}),(0,a.jsxs)(z.Z,{defaultValue:"all-keys",children:[(0,a.jsx)(V.Z,{value:"all-keys",onClick:()=>{ed(Y.from,Y.to,null)},children:"All Keys"},"all-keys"),null==i?void 0:i.map((e,l)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,a.jsx)(V.Z,{value:String(l),onClick:()=>{ed(Y.from,Y.to,e.token)},children:e.key_alias},l):null)]})]})]}),(0,a.jsx)(F.Z,{className:"mt-4",children:(0,a.jsxs)(L.Z,{className:"max-h-[70vh] min-h-[500px]",children:[(0,a.jsx)(K.Z,{children:(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(B.Z,{children:"End User"}),(0,a.jsx)(B.Z,{children:"Spend"}),(0,a.jsx)(B.Z,{children:"Total Events"})]})}),(0,a.jsx)(U.Z,{children:null==b?void 0:b.map((e,l)=>{var s;return(0,a.jsxs)(q.Z,{children:[(0,a.jsx)(D.Z,{children:e.end_user}),(0,a.jsx)(D.Z,{children:null===(s=e.total_spend)||void 0===s?void 0:s.toFixed(4)}),(0,a.jsx)(D.Z,{children:e.total_count})]},l)})})]})})]}),(0,a.jsx)(er.Z,{children:(0,a.jsxs)(x.Z,{numItems:2,className:"gap-2 h-[75vh] w-full mb-4",children:[(0,a.jsxs)(h.Z,{numColSpan:2,children:[(0,a.jsx)(es.Z,{className:"mb-4",enableSelect:!0,value:Y,onValueChange:e=>{$(e),eu(e.from,e.to)}}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(y.Z,{children:"Spend Per Tag"}),(0,a.jsxs)(_.Z,{children:["Get Started Tracking cost per tag ",(0,a.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/enterprise#tracking-spend-for-custom-tags",target:"_blank",children:"here"})]}),(0,a.jsx)(em.Z,{className:"h-72",data:w,index:"name",categories:["spend"],colors:["blue"]})]})]}),(0,a.jsx)(h.Z,{numColSpan:2})]})})]})]})]})},le=()=>{let{Title:e,Paragraph:l}=ee.default,[s,t]=(0,r.useState)(""),[n,o]=(0,r.useState)(!1),[d,c]=(0,r.useState)(null),[u,h]=(0,r.useState)(null),[x,p]=(0,r.useState)(null),[j,g]=(0,r.useState)(!0),Z=(0,i.useSearchParams)(),[f,_]=(0,r.useState)({data:[]}),y=Z.get("userID"),b=Z.get("token"),[v,S]=(0,r.useState)("api-keys"),[k,w]=(0,r.useState)(null);return(0,r.useEffect)(()=>{if(b){let e=(0,Q.o)(b);if(e){if(console.log("Decoded token:",e),console.log("Decoded key:",e.key),w(e.key),e.user_role){let l=function(e){if(!e)return"Undefined Role";switch(console.log("Received user role: ".concat(e.toLowerCase())),console.log("Received user role length: ".concat(e.toLowerCase().length)),e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(e.user_role);console.log("Decoded user_role:",l),t(l),"Admin Viewer"==l&&S("usage")}else console.log("User role not defined");e.user_email?c(e.user_email):console.log("User Email is not set ".concat(e)),e.login_method?g("username_password"==e.login_method):console.log("User Email is not set ".concat(e)),e.premium_user&&o(e.premium_user)}}},[b]),(0,a.jsx)(r.Suspense,{fallback:(0,a.jsx)("div",{children:"Loading..."}),children:(0,a.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,a.jsx)(m,{userID:y,userRole:s,userEmail:d,showSSOBanner:j,premiumUser:n}),(0,a.jsxs)("div",{className:"flex flex-1 overflow-auto",children:[(0,a.jsx)("div",{className:"mt-8",children:(0,a.jsx)(e8,{setPage:S,userRole:s,defaultSelectedKey:null})}),"api-keys"==v?(0,a.jsx)(el,{userID:y,userRole:s,teams:u,keys:x,setUserRole:t,userEmail:d,setUserEmail:c,setTeams:h,setKeys:p}):"models"==v?(0,a.jsx)(eE,{userID:y,userRole:s,token:b,accessToken:k,modelData:f,setModelData:_,premiumUser:n}):"llm-playground"==v?(0,a.jsx)(e1,{userID:y,userRole:s,token:b,accessToken:k}):"users"==v?(0,a.jsx)(eO,{userID:y,userRole:s,token:b,keys:x,teams:u,accessToken:k,setKeys:p}):"teams"==v?(0,a.jsx)(eR,{teams:u,setTeams:h,searchParams:Z,accessToken:k,userID:y,userRole:s}):"admin-panel"==v?(0,a.jsx)(eF,{setTeams:h,searchParams:Z,accessToken:k,showSSOBanner:j}):"api_ref"==v?(0,a.jsx)(eQ,{}):"settings"==v?(0,a.jsx)(eB,{userID:y,userRole:s,accessToken:k,premiumUser:n}):"budgets"==v?(0,a.jsx)(e$,{accessToken:k}):"general-settings"==v?(0,a.jsx)(eY,{userID:y,userRole:s,accessToken:k,modelData:f}):"model-hub"==v?(0,a.jsx)(eX.Z,{accessToken:k,publicPage:!1,premiumUser:n}):(0,a.jsx)(e9,{userID:y,userRole:s,token:b,accessToken:k,keys:x,premiumUser:n})]})]})})}}},function(e){e.O(0,[936,359,440,134,971,69,744],function(){return e(e.s=20661)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/index.html b/ui/litellm-dashboard/out/index.html index b12c05bc43..28d620ebfa 100644 --- a/ui/litellm-dashboard/out/index.html +++ b/ui/litellm-dashboard/out/index.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/ui/litellm-dashboard/out/index.txt b/ui/litellm-dashboard/out/index.txt index 99372005b8..15941a1346 100644 --- a/ui/litellm-dashboard/out/index.txt +++ b/ui/litellm-dashboard/out/index.txt @@ -1,7 +1,7 @@ 2:I[77831,[],""] -3:I[62631,["936","static/chunks/2f6dbc85-052c4579f80d66ae.js","359","static/chunks/359-f105a7fb61fe8110.js","440","static/chunks/440-b9a05f116e1a696d.js","134","static/chunks/134-af41d2d267857018.js","931","static/chunks/app/page-0f6ae871c63eb14b.js"],""] +3:I[5347,["936","static/chunks/2f6dbc85-052c4579f80d66ae.js","359","static/chunks/359-f105a7fb61fe8110.js","440","static/chunks/440-b9a05f116e1a696d.js","134","static/chunks/134-af41d2d267857018.js","931","static/chunks/app/page-1fb033a77b428a50.js"],""] 4:I[5613,[],""] 5:I[31778,[],""] -0:["XsAEnZvT8GWmMEp4_0in-",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},["$L1",["$","$L2",null,{"propsForComponent":{"params":{}},"Component":"$3","isStaticGeneration":true}],null]]},[null,["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_c23dc8","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}]}],null]],[[["$","link","0",{"rel":"stylesheet","href":"/ui/_next/static/css/338efd41b0181c1e.css","precedence":"next","crossOrigin":""}]],"$L6"]]]] +0:["QpcxqKJjVnif9CYPhpWjb",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},["$L1",["$","$L2",null,{"propsForComponent":{"params":{}},"Component":"$3","isStaticGeneration":true}],null]]},[null,["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_c23dc8","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}]}],null]],[[["$","link","0",{"rel":"stylesheet","href":"/ui/_next/static/css/338efd41b0181c1e.css","precedence":"next","crossOrigin":""}]],"$L6"]]]] 6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/ui/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null diff --git a/ui/litellm-dashboard/out/model_hub.html b/ui/litellm-dashboard/out/model_hub.html index 02ef53bef0..75b1c508bb 100644 --- a/ui/litellm-dashboard/out/model_hub.html +++ b/ui/litellm-dashboard/out/model_hub.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/ui/litellm-dashboard/out/model_hub.txt b/ui/litellm-dashboard/out/model_hub.txt index dd60dcaf67..3769dfc87e 100644 --- a/ui/litellm-dashboard/out/model_hub.txt +++ b/ui/litellm-dashboard/out/model_hub.txt @@ -2,6 +2,6 @@ 3:I[87494,["359","static/chunks/359-f105a7fb61fe8110.js","134","static/chunks/134-af41d2d267857018.js","418","static/chunks/app/model_hub/page-aa3c10cf9bb31255.js"],""] 4:I[5613,[],""] 5:I[31778,[],""] -0:["XsAEnZvT8GWmMEp4_0in-",[[["",{"children":["model_hub",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["model_hub",{"children":["__PAGE__",{},["$L1",["$","$L2",null,{"propsForComponent":{"params":{}},"Component":"$3","isStaticGeneration":true}],null]]},["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","model_hub","children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}]]},[null,["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_c23dc8","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}]}],null]],[[["$","link","0",{"rel":"stylesheet","href":"/ui/_next/static/css/338efd41b0181c1e.css","precedence":"next","crossOrigin":""}]],"$L6"]]]] +0:["QpcxqKJjVnif9CYPhpWjb",[[["",{"children":["model_hub",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["model_hub",{"children":["__PAGE__",{},["$L1",["$","$L2",null,{"propsForComponent":{"params":{}},"Component":"$3","isStaticGeneration":true}],null]]},["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","model_hub","children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}]]},[null,["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_c23dc8","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}]}],null]],[[["$","link","0",{"rel":"stylesheet","href":"/ui/_next/static/css/338efd41b0181c1e.css","precedence":"next","crossOrigin":""}]],"$L6"]]]] 6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/ui/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null diff --git a/ui/litellm-dashboard/src/components/edit_user.tsx b/ui/litellm-dashboard/src/components/edit_user.tsx index 4a822c4d12..850793d01b 100644 --- a/ui/litellm-dashboard/src/components/edit_user.tsx +++ b/ui/litellm-dashboard/src/components/edit_user.tsx @@ -36,10 +36,6 @@ const EditUserModal: React.FC = ({ visible, onCancel, user, form.resetFields(); }, [user]); - const handleChange = (e) => { - setEditedUser({ ...editedUser, [e.target.name]: e.target.value }); - }; - const handleCancel = async () => { form.resetFields(); onCancel(); diff --git a/ui/litellm-dashboard/src/components/usage.tsx b/ui/litellm-dashboard/src/components/usage.tsx index 3e388b4c39..ea50422c22 100644 --- a/ui/litellm-dashboard/src/components/usage.tsx +++ b/ui/litellm-dashboard/src/components/usage.tsx @@ -162,7 +162,7 @@ const UsagePage: React.FC = ({ console.log("keys in usage", keys); console.log("premium user in usage", premiumUser); - function valueFormatterNumbers(number) { + function valueFormatterNumbers(number: number) { const formatter = new Intl.NumberFormat('en-US', { maximumFractionDigits: 0, notation: 'compact', From fd3057f3b8a42ad122100422804b7e33478dd96a Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 29 May 2024 18:49:57 -0700 Subject: [PATCH 087/136] =?UTF-8?q?bump:=20version=201.39.2=20=E2=86=92=20?= =?UTF-8?q?1.39.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index bfba8e5c09..6deb1b58d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "litellm" -version = "1.39.2" +version = "1.39.3" description = "Library to easily interface with LLM API providers" authors = ["BerriAI"] license = "MIT" @@ -79,7 +79,7 @@ requires = ["poetry-core", "wheel"] build-backend = "poetry.core.masonry.api" [tool.commitizen] -version = "1.39.2" +version = "1.39.3" version_files = [ "pyproject.toml:^version" ] From 3e9410ffd6b640349ecc75a1e6973247f2987dda Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 29 May 2024 20:31:55 -0700 Subject: [PATCH 088/136] fix - test budget exceeded prisma --- docs/my-website/docs/proxy/users.md | 2 +- litellm/tests/test_key_generate_prisma.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/my-website/docs/proxy/users.md b/docs/my-website/docs/proxy/users.md index ec2be9cdc7..b1530da760 100644 --- a/docs/my-website/docs/proxy/users.md +++ b/docs/my-website/docs/proxy/users.md @@ -223,7 +223,7 @@ curl --location 'http://0.0.0.0:4000/chat/completions' \ Error ```shell -{"error":{"message":"Authentication Error, ExceededBudget: User ishaan3 has exceeded their budget. Current spend: 0.0008869999999999999; Max Budget: 0.0001","type":"auth_error","param":"None","code":401}}% +{"error":{"message":"Budget has been exceeded: User ishaan3 has exceeded their budget. Current spend: 0.0008869999999999999; Max Budget: 0.0001","type":"auth_error","param":"None","code":401}}% ``` diff --git a/litellm/tests/test_key_generate_prisma.py b/litellm/tests/test_key_generate_prisma.py index 528410ca63..d937beab45 100644 --- a/litellm/tests/test_key_generate_prisma.py +++ b/litellm/tests/test_key_generate_prisma.py @@ -467,7 +467,7 @@ def test_call_with_user_over_budget(prisma_client): asyncio.run(test()) except Exception as e: error_detail = e.message - assert "Authentication Error, ExceededBudget:" in error_detail + assert "Budget has been exceeded" in error_detail print(vars(e)) @@ -559,7 +559,7 @@ def test_call_with_end_user_over_budget(prisma_client): asyncio.run(test()) except Exception as e: error_detail = e.message - assert "Authentication Error, ExceededBudget:" in error_detail + assert "Budget has been exceeded" in error_detail print(vars(e)) @@ -648,7 +648,7 @@ def test_call_with_proxy_over_budget(prisma_client): error_detail = e.message else: error_detail = traceback.format_exc() - assert "Authentication Error, ExceededBudget:" in error_detail + assert "Budget has been exceeded" in error_detail print(vars(e)) @@ -726,7 +726,7 @@ def test_call_with_user_over_budget_stream(prisma_client): asyncio.run(test()) except Exception as e: error_detail = e.message - assert "Authentication Error, ExceededBudget:" in error_detail + assert "Budget has been exceeded" in error_detail print(vars(e)) @@ -823,7 +823,7 @@ def test_call_with_proxy_over_budget_stream(prisma_client): asyncio.run(test()) except Exception as e: error_detail = e.message - assert "Authentication Error, ExceededBudget:" in error_detail + assert "Budget has been exceeded" in error_detail print(vars(e)) From 3581d8ac8baa56bceb9f8c55a39f85b667a95542 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 29 May 2024 20:36:15 -0700 Subject: [PATCH 089/136] fix - vertex_ai/claude-3-opus@20240229 --- litellm/model_prices_and_context_window_backup.json | 4 ++-- model_prices_and_context_window.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index aab9c9af17..f090c5a3f6 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -1265,8 +1265,8 @@ "max_tokens": 4096, "max_input_tokens": 200000, "max_output_tokens": 4096, - "input_cost_per_token": 0.0000015, - "output_cost_per_token": 0.0000075, + "input_cost_per_token": 0.000015, + "output_cost_per_token": 0.000075, "litellm_provider": "vertex_ai-anthropic_models", "mode": "chat", "supports_function_calling": true, diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index aab9c9af17..f090c5a3f6 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -1265,8 +1265,8 @@ "max_tokens": 4096, "max_input_tokens": 200000, "max_output_tokens": 4096, - "input_cost_per_token": 0.0000015, - "output_cost_per_token": 0.0000075, + "input_cost_per_token": 0.000015, + "output_cost_per_token": 0.000075, "litellm_provider": "vertex_ai-anthropic_models", "mode": "chat", "supports_function_calling": true, From 6f063156be5457e57dbd7ba356e72c267e8e4b16 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 29 May 2024 20:48:08 -0700 Subject: [PATCH 090/136] fix test_call_with_end_user_over_budget --- litellm/tests/test_key_generate_prisma.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/litellm/tests/test_key_generate_prisma.py b/litellm/tests/test_key_generate_prisma.py index d937beab45..375a1c85d8 100644 --- a/litellm/tests/test_key_generate_prisma.py +++ b/litellm/tests/test_key_generate_prisma.py @@ -467,7 +467,7 @@ def test_call_with_user_over_budget(prisma_client): asyncio.run(test()) except Exception as e: error_detail = e.message - assert "Budget has been exceeded" in error_detail + assert "Authentication Error, ExceededBudget:" in error_detail print(vars(e)) @@ -559,7 +559,7 @@ def test_call_with_end_user_over_budget(prisma_client): asyncio.run(test()) except Exception as e: error_detail = e.message - assert "Budget has been exceeded" in error_detail + assert "Budget has been exceeded! Current" in error_detail print(vars(e)) @@ -648,7 +648,7 @@ def test_call_with_proxy_over_budget(prisma_client): error_detail = e.message else: error_detail = traceback.format_exc() - assert "Budget has been exceeded" in error_detail + assert "Authentication Error, ExceededBudget:" in error_detail print(vars(e)) @@ -726,7 +726,7 @@ def test_call_with_user_over_budget_stream(prisma_client): asyncio.run(test()) except Exception as e: error_detail = e.message - assert "Budget has been exceeded" in error_detail + assert "Authentication Error, ExceededBudget:" in error_detail print(vars(e)) @@ -823,7 +823,7 @@ def test_call_with_proxy_over_budget_stream(prisma_client): asyncio.run(test()) except Exception as e: error_detail = e.message - assert "Budget has been exceeded" in error_detail + assert "Authentication Error, ExceededBudget:" in error_detail print(vars(e)) From e6b68f35fd7228c049c038613b03d7438820a3f6 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 29 May 2024 20:56:22 -0700 Subject: [PATCH 091/136] fix - submit chat on enter --- ui/litellm-dashboard/src/components/chat_ui.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/litellm-dashboard/src/components/chat_ui.tsx b/ui/litellm-dashboard/src/components/chat_ui.tsx index 5bc9abde69..407e33dca3 100644 --- a/ui/litellm-dashboard/src/components/chat_ui.tsx +++ b/ui/litellm-dashboard/src/components/chat_ui.tsx @@ -149,6 +149,12 @@ const ChatUI: React.FC = ({ }); }; + const handleKeyDown = (event: React.KeyboardEvent) => { + if (event.key === 'Enter') { + handleSendMessage(); + } + }; + const handleSendMessage = async () => { if (inputMessage.trim() === "") return; @@ -260,6 +266,7 @@ const ChatUI: React.FC = ({ type="text" value={inputMessage} onChange={(e) => setInputMessage(e.target.value)} + onKeyDown={handleKeyDown} // Add this line placeholder="Type your message..." />
+ + {globalActivity.api_base} + + + + Num Rate Limit Errors {(globalActivity.sum_num_rate_limit_exceptions)} + + console.log(v)} + /> + + + + + + + ))} + + } + +
diff --git a/ui/litellm-dashboard/src/components/networking.tsx b/ui/litellm-dashboard/src/components/networking.tsx index d808166383..769e3b8346 100644 --- a/ui/litellm-dashboard/src/components/networking.tsx +++ b/ui/litellm-dashboard/src/components/networking.tsx @@ -1246,7 +1246,8 @@ export const adminGlobalActivityExceptions = async ( export const adminGlobalActivityExceptionsPerDeployment = async ( accessToken: String, startTime: String | undefined, - endTime: String | undefined + endTime: String | undefined, + modelGroup: String, ) => { try { let url = proxyBaseUrl @@ -1257,6 +1258,10 @@ export const adminGlobalActivityExceptionsPerDeployment = async ( url += `?start_date=${startTime}&end_date=${endTime}`; } + if (modelGroup) { + url += `&model_group=${modelGroup}`; + } + const requestOptions: { method: string; headers: { From 9a55365791b7242216096f28330fdd6c05e95b9d Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 30 May 2024 20:56:05 -0700 Subject: [PATCH 128/136] fix - rate lmit error dashboard --- litellm/proxy/proxy_server.py | 44 ++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 7241c1f247..b6e27cba60 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -6890,14 +6890,14 @@ async def get_global_activity_exceptions_per_deployment( const chartdata = [ { date: 'Jan 22', - num_exceptions: 10 + num_rate_limit_exceptions: 10 }, { date: 'Jan 23', - num_exceptions: 12 + num_rate_limit_exceptions: 12 }, ], - "sum_num_exceptions": 20, + "sum_num_rate_limit_exceptions": 20, }, { @@ -6906,14 +6906,14 @@ async def get_global_activity_exceptions_per_deployment( const chartdata = [ { date: 'Jan 22', - num_exceptions: 10, + num_rate_limit_exceptions: 10, }, { date: 'Jan 23', - num_exceptions: 12 + num_rate_limit_exceptions: 12 }, ], - "sum_num_exceptions": 20, + "sum_num_rate_limit_exceptions": 20, }, ] @@ -6940,13 +6940,14 @@ async def get_global_activity_exceptions_per_deployment( SELECT api_base, date_trunc('day', "startTime")::date AS date, - COUNT(*) AS num_exceptions + COUNT(*) AS num_rate_limit_exceptions FROM "LiteLLM_ErrorLogs" WHERE "startTime" >= $1::date AND "startTime" < ($2::date + INTERVAL '1 day') AND model_group = $3 + AND status_code = '429' GROUP BY api_base, date_trunc('day', "startTime") @@ -6968,19 +6969,21 @@ async def get_global_activity_exceptions_per_deployment( if _model not in model_ui_data: model_ui_data[_model] = { "daily_data": [], - "sum_num_exceptions": 0, + "sum_num_rate_limit_exceptions": 0, } _date_obj = datetime.fromisoformat(row["date"]) row["date"] = _date_obj.strftime("%b %d") model_ui_data[_model]["daily_data"].append(row) - model_ui_data[_model]["sum_num_exceptions"] += row.get("num_exceptions", 0) + model_ui_data[_model]["sum_num_rate_limit_exceptions"] += row.get( + "num_rate_limit_exceptions", 0 + ) # sort mode ui data by sum_api_requests -> get top 10 models model_ui_data = dict( sorted( model_ui_data.items(), - key=lambda x: x[1]["sum_num_exceptions"], + key=lambda x: x[1]["sum_num_rate_limit_exceptions"], reverse=True, )[:10] ) @@ -6993,7 +6996,9 @@ async def get_global_activity_exceptions_per_deployment( { "api_base": model, "daily_data": _sort_daily_data, - "sum_num_exceptions": data["sum_num_exceptions"], + "sum_num_rate_limit_exceptions": data[ + "sum_num_rate_limit_exceptions" + ], } ) @@ -7035,11 +7040,11 @@ async def get_global_activity_exceptions( const chartdata = [ { date: 'Jan 22', - num_exceptions: 10, + num_rate_limit_exceptions: 10, }, { date: 'Jan 23', - num_exceptions: 10, + num_rate_limit_exceptions: 10, }, ], "sum_api_exceptions": 20, @@ -7066,13 +7071,14 @@ async def get_global_activity_exceptions( sql_query = """ SELECT date_trunc('day', "startTime")::date AS date, - COUNT(*) AS num_exceptions + COUNT(*) AS num_rate_limit_exceptions FROM "LiteLLM_ErrorLogs" WHERE "startTime" >= $1::date AND "startTime" < ($2::date + INTERVAL '1 day') AND model_group = $3 + AND status_code = '429' GROUP BY date_trunc('day', "startTime") ORDER BY @@ -7085,7 +7091,7 @@ async def get_global_activity_exceptions( if db_response is None: return [] - sum_num_exceptions = 0 + sum_num_rate_limit_exceptions = 0 daily_data = [] for row in db_response: # cast date to datetime @@ -7093,14 +7099,14 @@ async def get_global_activity_exceptions( row["date"] = _date_obj.strftime("%b %d") daily_data.append(row) - sum_num_exceptions += row.get("num_exceptions", 0) + sum_num_rate_limit_exceptions += row.get("num_rate_limit_exceptions", 0) # sort daily_data by date daily_data = sorted(daily_data, key=lambda x: x["date"]) data_to_return = { "daily_data": daily_data, - "sum_num_exceptions": sum_num_exceptions, + "sum_num_rate_limit_exceptions": sum_num_rate_limit_exceptions, } return data_to_return @@ -10830,7 +10836,7 @@ async def model_metrics_exceptions( SELECT CASE WHEN api_base = '' THEN litellm_model_name ELSE CONCAT(litellm_model_name, '-', api_base) END AS combined_model_api_base, exception_type, - COUNT(*) AS num_exceptions + COUNT(*) AS num_rate_limit_exceptions FROM "LiteLLM_ErrorLogs" WHERE "startTime" >= $1::timestamp AND "endTime" <= $2::timestamp AND model_group = $3 GROUP BY combined_model_api_base, exception_type @@ -10838,7 +10844,7 @@ async def model_metrics_exceptions( SELECT combined_model_api_base, COUNT(*) AS total_exceptions, - json_object_agg(exception_type, num_exceptions) AS exception_counts + json_object_agg(exception_type, num_rate_limit_exceptions) AS exception_counts FROM cte GROUP BY combined_model_api_base ORDER BY total_exceptions DESC From 473ae19c2acce147f6119e195ea58a697c4ce7b5 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 30 May 2024 20:57:47 -0700 Subject: [PATCH 129/136] =?UTF-8?q?bump:=20version=201.39.4=20=E2=86=92=20?= =?UTF-8?q?1.39.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a6a6a86429..49ca81db62 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "litellm" -version = "1.39.4" +version = "1.39.5" description = "Library to easily interface with LLM API providers" authors = ["BerriAI"] license = "MIT" @@ -79,7 +79,7 @@ requires = ["poetry-core", "wheel"] build-backend = "poetry.core.masonry.api" [tool.commitizen] -version = "1.39.4" +version = "1.39.5" version_files = [ "pyproject.toml:^version" ] From aada7b4bd390d1508345412c8a3622449ecd3ab1 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 30 May 2024 20:59:51 -0700 Subject: [PATCH 130/136] ui new build --- litellm/proxy/_experimental/out/404.html | 2 +- .../_buildManifest.js | 0 .../_ssgManifest.js | 0 .../static/chunks/134-4a7b43f992182f2c.js | 1 + .../static/chunks/134-c90bc0ea89aa9575.js | 1 - .../static/chunks/359-15429935a96e2644.js | 20 ------------------- .../static/chunks/359-f105a7fb61fe8110.js | 20 +++++++++++++++++++ ...0d5edc0803a.js => 440-b9a05f116e1a696d.js} | 4 ++-- .../chunks/app/page-b352842da2a28567.js | 1 - .../chunks/app/page-f610596e5fb3cce4.js | 1 + litellm/proxy/_experimental/out/index.html | 2 +- litellm/proxy/_experimental/out/index.txt | 4 ++-- .../proxy/_experimental/out/model_hub.html | 2 +- litellm/proxy/_experimental/out/model_hub.txt | 4 ++-- ui/litellm-dashboard/out/404.html | 2 +- .../_buildManifest.js | 0 .../_ssgManifest.js | 0 .../static/chunks/134-4a7b43f992182f2c.js | 1 + .../static/chunks/134-c90bc0ea89aa9575.js | 1 - .../static/chunks/359-15429935a96e2644.js | 20 ------------------- .../static/chunks/359-f105a7fb61fe8110.js | 20 +++++++++++++++++++ ...0d5edc0803a.js => 440-b9a05f116e1a696d.js} | 4 ++-- .../chunks/app/page-b352842da2a28567.js | 1 - .../chunks/app/page-f610596e5fb3cce4.js | 1 + ui/litellm-dashboard/out/index.html | 2 +- ui/litellm-dashboard/out/index.txt | 4 ++-- ui/litellm-dashboard/out/model_hub.html | 2 +- ui/litellm-dashboard/out/model_hub.txt | 4 ++-- 28 files changed, 62 insertions(+), 62 deletions(-) rename litellm/proxy/_experimental/out/_next/static/{DZeuXGCKZ5FspQI6YUqsb => PcGFjo5-03lHREJ3E0k6y}/_buildManifest.js (100%) rename litellm/proxy/_experimental/out/_next/static/{DZeuXGCKZ5FspQI6YUqsb => PcGFjo5-03lHREJ3E0k6y}/_ssgManifest.js (100%) create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/134-4a7b43f992182f2c.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/134-c90bc0ea89aa9575.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/359-15429935a96e2644.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/359-f105a7fb61fe8110.js rename litellm/proxy/_experimental/out/_next/static/chunks/{440-5f9900d5edc0803a.js => 440-b9a05f116e1a696d.js} (52%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/page-b352842da2a28567.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/page-f610596e5fb3cce4.js rename ui/litellm-dashboard/out/_next/static/{DZeuXGCKZ5FspQI6YUqsb => PcGFjo5-03lHREJ3E0k6y}/_buildManifest.js (100%) rename ui/litellm-dashboard/out/_next/static/{DZeuXGCKZ5FspQI6YUqsb => PcGFjo5-03lHREJ3E0k6y}/_ssgManifest.js (100%) create mode 100644 ui/litellm-dashboard/out/_next/static/chunks/134-4a7b43f992182f2c.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/134-c90bc0ea89aa9575.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/359-15429935a96e2644.js create mode 100644 ui/litellm-dashboard/out/_next/static/chunks/359-f105a7fb61fe8110.js rename ui/litellm-dashboard/out/_next/static/chunks/{440-5f9900d5edc0803a.js => 440-b9a05f116e1a696d.js} (52%) delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/page-b352842da2a28567.js create mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/page-f610596e5fb3cce4.js diff --git a/litellm/proxy/_experimental/out/404.html b/litellm/proxy/_experimental/out/404.html index a53f906ff2..a578410881 100644 --- a/litellm/proxy/_experimental/out/404.html +++ b/litellm/proxy/_experimental/out/404.html @@ -1 +1 @@ -404: This page could not be found.LiteLLM Dashboard

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.LiteLLM Dashboard

404

This page could not be found.

\ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/DZeuXGCKZ5FspQI6YUqsb/_buildManifest.js b/litellm/proxy/_experimental/out/_next/static/PcGFjo5-03lHREJ3E0k6y/_buildManifest.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/DZeuXGCKZ5FspQI6YUqsb/_buildManifest.js rename to litellm/proxy/_experimental/out/_next/static/PcGFjo5-03lHREJ3E0k6y/_buildManifest.js diff --git a/litellm/proxy/_experimental/out/_next/static/DZeuXGCKZ5FspQI6YUqsb/_ssgManifest.js b/litellm/proxy/_experimental/out/_next/static/PcGFjo5-03lHREJ3E0k6y/_ssgManifest.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/DZeuXGCKZ5FspQI6YUqsb/_ssgManifest.js rename to litellm/proxy/_experimental/out/_next/static/PcGFjo5-03lHREJ3E0k6y/_ssgManifest.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/134-4a7b43f992182f2c.js b/litellm/proxy/_experimental/out/_next/static/chunks/134-4a7b43f992182f2c.js new file mode 100644 index 0000000000..edaa2fe9e2 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/134-4a7b43f992182f2c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[134],{41134:function(e,t,o){o.d(t,{Z:function(){return j}});var r=o(3827),a=o(64090),n=o(47907),s=o(777),c=o(16450),l=o(13810),i=o(92836),d=o(26734),h=o(41608),p=o(32126),u=o(23682),w=o(71801),m=o(42440),y=o(84174),f=o(50459),k=o(1460),g=o(99129),x=o(67951),j=e=>{var t;let{accessToken:o,publicPage:j,premiumUser:_}=e,[T,b]=(0,a.useState)(!1),[E,N]=(0,a.useState)(null),[A,P]=(0,a.useState)(!1),[Z,F]=(0,a.useState)(!1),[C,v]=(0,a.useState)(null),S=(0,n.useRouter)();(0,a.useEffect)(()=>{o&&(async()=>{try{let e=await (0,s.kn)(o);console.log("ModelHubData:",e),N(e.data),(0,s.E9)(o,"enable_public_model_hub").then(e=>{console.log("data: ".concat(JSON.stringify(e))),!0==e.field_value&&b(!0)}).catch(e=>{})}catch(e){console.error("There was an error fetching the model data",e)}})()},[o,j]);let O=e=>{v(e),P(!0)},z=async()=>{o&&(0,s.jA)(o,"enable_public_model_hub",!0).then(e=>{F(!0)})},B=()=>{P(!1),F(!1),v(null)},G=()=>{P(!1),F(!1),v(null)},I=e=>{navigator.clipboard.writeText(e)};return(0,r.jsxs)("div",{children:[j&&T||!1==j?(0,r.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,r.jsx)("div",{className:"relative w-full"}),(0,r.jsxs)("div",{className:"flex ".concat(j?"justify-between":"items-center"),children:[(0,r.jsx)(m.Z,{className:"ml-8 text-center ",children:"Model Hub"}),!1==j?_?(0,r.jsx)(c.Z,{className:"ml-4",onClick:()=>z(),children:"✨ Make Public"}):(0,r.jsx)(c.Z,{className:"ml-4",children:(0,r.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Make Public"})}):(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsx)("p",{children:"Filter by key:"}),(0,r.jsx)(w.Z,{className:"bg-gray-200 pr-2 pl-2 pt-1 pb-1 text-center",children:"/ui/model_hub?key="})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-2 gap-6 sm:grid-cols-3 lg:grid-cols-4",children:E&&E.map(e=>(0,r.jsxs)(l.Z,{className:"mt-5 mx-8",children:[(0,r.jsxs)("pre",{className:"flex justify-between",children:[(0,r.jsx)(m.Z,{children:e.model_group}),(0,r.jsx)(k.Z,{title:e.model_group,children:(0,r.jsx)(y.Z,{onClick:()=>I(e.model_group),style:{cursor:"pointer",marginRight:"10px"}})})]}),(0,r.jsxs)("div",{className:"my-5",children:[(0,r.jsxs)(w.Z,{children:["Mode: ",e.mode]}),(0,r.jsxs)(w.Z,{children:["Supports Function Calling:"," ",(null==e?void 0:e.supports_function_calling)==!0?"Yes":"No"]}),(0,r.jsxs)(w.Z,{children:["Supports Vision:"," ",(null==e?void 0:e.supports_vision)==!0?"Yes":"No"]}),(0,r.jsxs)(w.Z,{children:["Max Input Tokens:"," ",(null==e?void 0:e.max_input_tokens)?null==e?void 0:e.max_input_tokens:"N/A"]}),(0,r.jsxs)(w.Z,{children:["Max Output Tokens:"," ",(null==e?void 0:e.max_output_tokens)?null==e?void 0:e.max_output_tokens:"N/A"]})]}),(0,r.jsx)("div",{style:{marginTop:"auto",textAlign:"right"},children:(0,r.jsxs)("a",{href:"#",onClick:()=>O(e),style:{color:"#1890ff",fontSize:"smaller"},children:["View more ",(0,r.jsx)(f.Z,{})]})})]},e.model_group))})]}):(0,r.jsxs)(l.Z,{className:"mx-auto max-w-xl mt-10",children:[(0,r.jsx)(w.Z,{className:"text-xl text-center mb-2 text-black",children:"Public Model Hub not enabled."}),(0,r.jsx)("p",{className:"text-base text-center text-slate-800",children:"Ask your proxy admin to enable this on their Admin UI."})]}),(0,r.jsx)(g.Z,{title:"Public Model Hub",width:600,visible:Z,footer:null,onOk:B,onCancel:G,children:(0,r.jsxs)("div",{className:"pt-5 pb-5",children:[(0,r.jsxs)("div",{className:"flex justify-between mb-4",children:[(0,r.jsx)(w.Z,{className:"text-base mr-2",children:"Shareable Link:"}),(0,r.jsx)(w.Z,{className:"max-w-sm ml-2 bg-gray-200 pr-2 pl-2 pt-1 pb-1 text-center rounded",children:"/ui/model_hub?key="})]}),(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsx)(c.Z,{onClick:()=>{S.replace("/model_hub?key=".concat(o))},children:"See Page"})})]})}),(0,r.jsx)(g.Z,{title:C&&C.model_group?C.model_group:"Unknown Model",width:800,visible:A,footer:null,onOk:B,onCancel:G,children:C&&(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-4",children:(0,r.jsx)("strong",{children:"Model Information & Usage"})}),(0,r.jsxs)(d.Z,{children:[(0,r.jsxs)(h.Z,{children:[(0,r.jsx)(i.Z,{children:"OpenAI Python SDK"}),(0,r.jsx)(i.Z,{children:"Supported OpenAI Params"}),(0,r.jsx)(i.Z,{children:"LlamaIndex"}),(0,r.jsx)(i.Z,{children:"Langchain Py"})]}),(0,r.jsxs)(u.Z,{children:[(0,r.jsx)(p.Z,{children:(0,r.jsx)(x.Z,{language:"python",children:'\nimport openai\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="http://0.0.0.0:4000" # LiteLLM Proxy is OpenAI compatible, Read More: https://docs.litellm.ai/docs/proxy/user_keys\n)\n\nresponse = client.chat.completions.create(\n model="'.concat(C.model_group,'", # model to send to the proxy\n messages = [\n {\n "role": "user",\n "content": "this is a test request, write a short poem"\n }\n ]\n)\n\nprint(response)\n ')})}),(0,r.jsx)(p.Z,{children:(0,r.jsx)(x.Z,{language:"python",children:"".concat(null===(t=C.supported_openai_params)||void 0===t?void 0:t.map(e=>"".concat(e,"\n")).join(""))})}),(0,r.jsx)(p.Z,{children:(0,r.jsx)(x.Z,{language:"python",children:'\nimport os, dotenv\n\nfrom llama_index.llms import AzureOpenAI\nfrom llama_index.embeddings import AzureOpenAIEmbedding\nfrom llama_index import VectorStoreIndex, SimpleDirectoryReader, ServiceContext\n\nllm = AzureOpenAI(\n engine="'.concat(C.model_group,'", # model_name on litellm proxy\n temperature=0.0,\n azure_endpoint="http://0.0.0.0:4000", # litellm proxy endpoint\n api_key="sk-1234", # litellm proxy API Key\n api_version="2023-07-01-preview",\n)\n\nembed_model = AzureOpenAIEmbedding(\n deployment_name="azure-embedding-model",\n azure_endpoint="http://0.0.0.0:4000",\n api_key="sk-1234",\n api_version="2023-07-01-preview",\n)\n\n\ndocuments = SimpleDirectoryReader("llama_index_data").load_data()\nservice_context = ServiceContext.from_defaults(llm=llm, embed_model=embed_model)\nindex = VectorStoreIndex.from_documents(documents, service_context=service_context)\n\nquery_engine = index.as_query_engine()\nresponse = query_engine.query("What did the author do growing up?")\nprint(response)\n\n ')})}),(0,r.jsx)(p.Z,{children:(0,r.jsx)(x.Z,{language:"python",children:'\nfrom langchain.chat_models import ChatOpenAI\nfrom langchain.prompts.chat import (\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n SystemMessagePromptTemplate,\n)\nfrom langchain.schema import HumanMessage, SystemMessage\n\nchat = ChatOpenAI(\n openai_api_base="http://0.0.0.0:4000",\n model = "'.concat(C.model_group,'",\n temperature=0.1\n)\n\nmessages = [\n SystemMessage(\n content="You are a helpful assistant that im using to make a test request to."\n ),\n HumanMessage(\n content="test from litellm. tell me why it\'s amazing in 1 sentence"\n ),\n]\nresponse = chat(messages)\n\nprint(response)\n\n ')})})]})]})]})})]})}},777:function(e,t,o){o.d(t,{AZ:function(){return k},Au:function(){return B},BL:function(){return K},Br:function(){return m},E9:function(){return W},EY:function(){return ee},FC:function(){return P},Gh:function(){return V},HK:function(){return A},I1:function(){return u},J$:function(){return N},K_:function(){return $},N8:function(){return T},NV:function(){return l},Nc:function(){return M},O3:function(){return Y},OU:function(){return C},Og:function(){return c},Ov:function(){return p},Qy:function(){return f},RQ:function(){return d},Rg:function(){return j},So:function(){return b},Xd:function(){return I},Xm:function(){return y},YU:function(){return D},Zr:function(){return i},ao:function(){return Q},b1:function(){return F},cu:function(){return H},e2:function(){return G},fP:function(){return _},hT:function(){return R},hy:function(){return s},jA:function(){return X},jE:function(){return L},kK:function(){return n},kn:function(){return g},lg:function(){return J},mR:function(){return E},n$:function(){return O},o6:function(){return x},pf:function(){return q},qm:function(){return a},rs:function(){return w},tN:function(){return Z},um:function(){return U},v9:function(){return z},wX:function(){return h},wd:function(){return v},xA:function(){return S}});var r=o(80588);let a=async()=>{try{let e=await fetch("https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json"),t=await e.json();return console.log("received data: ".concat(t)),t}catch(e){throw console.error("Failed to get model cost map:",e),e}},n=async(e,t)=>{try{let o=await fetch("/model/new",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!o.ok){let e=await o.text();throw r.ZP.error("Failed to create key: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let a=await o.json();return console.log("API Response:",a),r.ZP.success("Model created successfully. Wait 60s and refresh on 'All Models' page"),a}catch(e){throw console.error("Failed to create key:",e),e}},s=async e=>{try{let t=await fetch("/model/settings",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await t.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},c=async(e,t)=>{console.log("model_id in model delete call: ".concat(t));try{let o=await fetch("/model/delete",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({id:t})});if(!o.ok){let e=await o.text();throw r.ZP.error("Failed to create key: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let a=await o.json();return console.log("API Response:",a),r.ZP.success("Model deleted successfully. Restart server to see this."),a}catch(e){throw console.error("Failed to create key:",e),e}},l=async(e,t)=>{if(console.log("budget_id in budget delete call: ".concat(t)),null!=e)try{let o=await fetch("/budget/delete",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({id:t})});if(!o.ok){let e=await o.text();throw r.ZP.error("Failed to create key: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let a=await o.json();return console.log("API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},i=async(e,t)=>{try{console.log("Form Values in budgetCreateCall:",t),console.log("Form Values after check:",t);let o=await fetch("/budget/new",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!o.ok){let e=await o.text();throw r.ZP.error("Failed to create key: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let a=await o.json();return console.log("API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},d=async e=>{try{let t=await fetch("/alerting/settings",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await t.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},h=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.metadata){console.log("formValues.metadata:",o.metadata);try{o.metadata=JSON.parse(o.metadata)}catch(e){throw r.ZP.error("Failed to parse metadata: "+e,10),Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",o);let a=await fetch("/key/generate",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...o})});if(!a.ok){let e=await a.text();throw r.ZP.error("Failed to create key: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await a.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},p=async(e,t,o)=>{try{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.metadata){console.log("formValues.metadata:",o.metadata);try{o.metadata=JSON.parse(o.metadata)}catch(e){throw r.ZP.error("Failed to parse metadata: "+e,10),Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",o);let a=await fetch("/user/new",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...o})});if(!a.ok){let e=await a.text();throw r.ZP.error("Failed to create key: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await a.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},u=async(e,t)=>{try{console.log("in keyDeleteCall:",t);let o=await fetch("/key/delete",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({keys:[t]})});if(!o.ok){let e=await o.text();throw r.ZP.error("Failed to delete key: "+e,10),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},w=async(e,t)=>{try{console.log("in teamDeleteCall:",t);let o=await fetch("/team/delete",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_ids:[t]})});if(!o.ok){let e=await o.text();throw r.ZP.error("Failed to delete team: "+e,10),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to delete key:",e),e}},m=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0;try{let c="/user/info";"App Owner"==o&&t&&(c="".concat(c,"?user_id=").concat(t)),"App User"==o&&t&&(c="".concat(c,"?user_id=").concat(t)),console.log("in userInfoCall viewAll=",a),a&&s&&null!=n&&void 0!=n&&(c="".concat(c,"?view_all=true&page=").concat(n,"&page_size=").concat(s));let l=await fetch(c,{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let i=await l.json();return console.log("API Response:",i),i}catch(e){throw console.error("Failed to create key:",e),e}},y=async(e,t)=>{try{let o="/team/info";t&&(o="".concat(o,"?team_id=").concat(t)),console.log("in teamInfoCall");let a=await fetch(o,{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let n=await a.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},f=async e=>{try{let t=await fetch("/global/spend",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await t.json()}catch(e){throw console.error("Failed to create key:",e),e}},k=async(e,t,o)=>{try{let t=await fetch("/v2/model/info",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let o=await t.json();return console.log("modelInfoCall:",o),o}catch(e){throw console.error("Failed to create key:",e),e}},g=async e=>{try{let t=await fetch("/model_group/info",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let o=await t.json();return console.log("modelHubCall:",o),o}catch(e){throw console.error("Failed to create key:",e),e}},x=async(e,t,o,a,n,s)=>{try{let t="/model/metrics";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(n,"&endTime=").concat(s));let o=await fetch(t,{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},j=async(e,t,o,a)=>{try{let n="/model/streaming_metrics";t&&(n="".concat(n,"?_selected_model_group=").concat(t,"&startTime=").concat(o,"&endTime=").concat(a));let s=await fetch(n,{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!s.ok){let e=await s.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await s.json()}catch(e){throw console.error("Failed to create key:",e),e}},_=async(e,t,o,a,n,s)=>{try{let t="/model/metrics/slow_responses";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(n,"&endTime=").concat(s));let o=await fetch(t,{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},T=async(e,t,o,a,n,s)=>{try{let t="/model/metrics/exceptions";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(n,"&endTime=").concat(s));let o=await fetch(t,{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},b=async(e,t,o)=>{try{let t=await fetch("/models",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await t.json()}catch(e){throw console.error("Failed to create key:",e),e}},E=async e=>{try{let t="/global/spend/teams";console.log("in teamSpendLogsCall:",t);let o=await fetch("".concat(t),{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},N=async(e,t,o)=>{try{let r="/global/spend/tags";t&&o&&(r="".concat(r,"?start_date=").concat(t,"&end_date=").concat(o)),console.log("in tagsSpendLogsCall:",r);let a=await fetch("".concat(r),{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok)throw await a.text(),Error("Network response was not ok");let n=await a.json();return console.log(n),n}catch(e){throw console.error("Failed to create key:",e),e}},A=async(e,t,o,a,n,s)=>{try{console.log("user role in spend logs call: ".concat(o));let t="/spend/logs";t="App Owner"==o?"".concat(t,"?user_id=").concat(a,"&start_date=").concat(n,"&end_date=").concat(s):"".concat(t,"?start_date=").concat(n,"&end_date=").concat(s);let c=await fetch(t,{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!c.ok){let e=await c.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let l=await c.json();return console.log(l),l}catch(e){throw console.error("Failed to create key:",e),e}},P=async e=>{try{let t=await fetch("/global/spend/logs",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let o=await t.json();return console.log(o),o}catch(e){throw console.error("Failed to create key:",e),e}},Z=async e=>{try{let t=await fetch("/global/spend/keys?limit=5",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let o=await t.json();return console.log(o),o}catch(e){throw console.error("Failed to create key:",e),e}},F=async(e,t,o,a)=>{try{let n="";n=t?JSON.stringify({api_key:t,startTime:o,endTime:a}):JSON.stringify({startTime:o,endTime:a});let s={method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}};s.body=n;let c=await fetch("/global/spend/end_users",s);if(!c.ok){let e=await c.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let l=await c.json();return console.log(l),l}catch(e){throw console.error("Failed to create key:",e),e}},C=async(e,t,o,a)=>{try{let n="/global/spend/provider";o&&a&&(n+="?start_date=".concat(o,"&end_date=").concat(a)),t&&(n+="&api_key=".concat(t));let s=await fetch(n,{method:"GET",headers:{Authorization:"Bearer ".concat(e)}});if(!s.ok){let e=await s.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let c=await s.json();return console.log(c),c}catch(e){throw console.error("Failed to fetch spend data:",e),e}},v=async(e,t,o)=>{try{let r="/global/activity";t&&o&&(r+="?start_date=".concat(t,"&end_date=").concat(o));let a=await fetch(r,{method:"GET",headers:{Authorization:"Bearer ".concat(e)}});if(!a.ok)throw await a.text(),Error("Network response was not ok");let n=await a.json();return console.log(n),n}catch(e){throw console.error("Failed to fetch spend data:",e),e}},S=async(e,t,o)=>{try{let r="/global/activity/model";t&&o&&(r+="?start_date=".concat(t,"&end_date=").concat(o));let a=await fetch(r,{method:"GET",headers:{Authorization:"Bearer ".concat(e)}});if(!a.ok)throw await a.text(),Error("Network response was not ok");let n=await a.json();return console.log(n),n}catch(e){throw console.error("Failed to fetch spend data:",e),e}},O=async(e,t,o,r)=>{try{let a="/global/activity/exceptions";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o)),r&&(a+="&model_group=".concat(r));let n=await fetch(a,{method:"GET",headers:{Authorization:"Bearer ".concat(e)}});if(!n.ok)throw await n.text(),Error("Network response was not ok");let s=await n.json();return console.log(s),s}catch(e){throw console.error("Failed to fetch spend data:",e),e}},z=async(e,t,o,r)=>{try{let a="/global/activity/exceptions/deployment";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o)),r&&(a+="&model_group=".concat(r));let n=await fetch(a,{method:"GET",headers:{Authorization:"Bearer ".concat(e)}});if(!n.ok)throw await n.text(),Error("Network response was not ok");let s=await n.json();return console.log(s),s}catch(e){throw console.error("Failed to fetch spend data:",e),e}},B=async e=>{try{let t=await fetch("/global/spend/models?limit=5",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let o=await t.json();return console.log(o),o}catch(e){throw console.error("Failed to create key:",e),e}},G=async(e,t)=>{try{let o=await fetch("/v2/key/info",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({keys:t})});if(!o.ok){let e=await o.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},I=async(e,t)=>{try{let o="/user/get_users?role=".concat(t);console.log("in userGetAllUsersCall:",o);let a=await fetch(o,{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw r.ZP.error("Failed to delete key: "+e,10),Error("Network response was not ok")}let n=await a.json();return console.log(n),n}catch(e){throw console.error("Failed to get requested models:",e),e}},J=async e=>{try{let t=await fetch("/user/available_roles",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok)throw await t.text(),Error("Network response was not ok");let o=await t.json();return console.log("response from user/available_role",o),o}catch(e){throw e}},R=async(e,t)=>{try{console.log("Form Values in teamCreateCall:",t);let o=await fetch("/team/new",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!o.ok){let e=await o.text();throw r.ZP.error("Failed to create key: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let a=await o.json();return console.log("API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},M=async(e,t)=>{try{console.log("Form Values in keyUpdateCall:",t);let o=await fetch("/key/update",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!o.ok){let e=await o.text();throw r.ZP.error("Failed to update key: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let a=await o.json();return console.log("Update key Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},V=async(e,t)=>{try{console.log("Form Values in teamUpateCall:",t);let o=await fetch("/team/update",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!o.ok){let e=await o.text();throw r.ZP.error("Failed to update team: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let a=await o.json();return console.log("Update Team Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},U=async(e,t)=>{try{console.log("Form Values in modelUpateCall:",t);let o=await fetch("/model/update",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!o.ok){let e=await o.text();throw r.ZP.error("Failed to update model: "+e,10),console.error("Error update from the server:",e),Error("Network response was not ok")}let a=await o.json();return console.log("Update model Response:",a),a}catch(e){throw console.error("Failed to update model:",e),e}},H=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let a=await fetch("/team/member_add",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,member:o})});if(!a.ok){let e=await a.text();throw r.ZP.error("Failed to create key: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await a.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},q=async(e,t,o)=>{try{console.log("Form Values in userUpdateUserCall:",t);let a={...t};null!==o&&(a.user_role=o),a=JSON.stringify(a);let n=await fetch("/user/update",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:a});if(!n.ok){let e=await n.text();throw r.ZP.error("Failed to create key: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let s=await n.json();return console.log("API Response:",s),s}catch(e){throw console.error("Failed to create key:",e),e}},L=async(e,t)=>{try{let o="/health/services?service=".concat(t);console.log("Checking Slack Budget Alerts service health");let a=await fetch(o,{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw r.ZP.error("Failed ".concat(t," service health check ")+e),Error(e)}let n=await a.json();return r.ZP.success("Test request to ".concat(t," made - check logs/alerts on ").concat(t," to verify")),n}catch(e){throw console.error("Failed to perform health check:",e),e}},Y=async e=>{try{let t=await fetch("/budget/list",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await t.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},K=async(e,t,o)=>{try{let t=await fetch("/get/config/callbacks",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await t.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},D=async e=>{try{let t=await fetch("/config/list?config_type=general_settings",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await t.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},W=async(e,t)=>{try{let o=await fetch("/config/field/info?field_name=".concat(t),{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");return await o.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},X=async(e,t,o)=>{try{let a=await fetch("/config/field/update",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,field_value:o,config_type:"general_settings"})});if(!a.ok){let e=await a.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let n=await a.json();return r.ZP.success("Successfully updated value!"),n}catch(e){throw console.error("Failed to set callbacks:",e),e}},Q=async(e,t)=>{try{let o=await fetch("/config/field/delete",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,config_type:"general_settings"})});if(!o.ok){let e=await o.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let a=await o.json();return r.ZP.success("Field reset on proxy"),a}catch(e){throw console.error("Failed to get callbacks:",e),e}},$=async(e,t)=>{try{let o=await fetch("/config/update",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!o.ok){let e=await o.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},ee=async e=>{try{let t=await fetch("/health",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e),Error("Network response was not ok")}return await t.json()}catch(e){throw console.error("Failed to call /health:",e),e}}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/134-c90bc0ea89aa9575.js b/litellm/proxy/_experimental/out/_next/static/chunks/134-c90bc0ea89aa9575.js deleted file mode 100644 index e3e8f5b07a..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/134-c90bc0ea89aa9575.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[134],{41134:function(e,t,o){o.d(t,{Z:function(){return x}});var r=o(3827),a=o(64090),n=o(47907),s=o(777),c=o(16450),l=o(13810),i=o(92836),d=o(26734),h=o(41608),p=o(32126),u=o(23682),w=o(71801),m=o(42440),y=o(84174),f=o(50459),k=o(1460),g=o(99129),j=o(67951),x=e=>{var t;let{accessToken:o,publicPage:x,premiumUser:_}=e,[T,b]=(0,a.useState)(!1),[N,E]=(0,a.useState)(null),[P,A]=(0,a.useState)(!1),[Z,F]=(0,a.useState)(!1),[C,v]=(0,a.useState)(null),S=(0,n.useRouter)();(0,a.useEffect)(()=>{o&&(async()=>{try{let e=await (0,s.kn)(o);console.log("ModelHubData:",e),E(e.data),(0,s.E9)(o,"enable_public_model_hub").then(e=>{console.log("data: ".concat(JSON.stringify(e))),!0==e.field_value&&b(!0)}).catch(e=>{})}catch(e){console.error("There was an error fetching the model data",e)}})()},[o,x]);let O=e=>{v(e),A(!0)},z=async()=>{o&&(0,s.jA)(o,"enable_public_model_hub",!0).then(e=>{F(!0)})},B=()=>{A(!1),F(!1),v(null)},I=()=>{A(!1),F(!1),v(null)},G=e=>{navigator.clipboard.writeText(e)};return(0,r.jsxs)("div",{children:[x&&T||!1==x?(0,r.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,r.jsx)("div",{className:"relative w-full"}),(0,r.jsxs)("div",{className:"flex ".concat(x?"justify-between":"items-center"),children:[(0,r.jsx)(m.Z,{className:"ml-8 text-center ",children:"Model Hub"}),!1==x?_?(0,r.jsx)(c.Z,{className:"ml-4",onClick:()=>z(),children:"✨ Make Public"}):(0,r.jsx)(c.Z,{className:"ml-4",children:(0,r.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Make Public"})}):(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsx)("p",{children:"Filter by key:"}),(0,r.jsx)(w.Z,{className:"bg-gray-200 pr-2 pl-2 pt-1 pb-1 text-center",children:"/ui/model_hub?key="})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-2 gap-6 sm:grid-cols-3 lg:grid-cols-4",children:N&&N.map(e=>(0,r.jsxs)(l.Z,{className:"mt-5 mx-8",children:[(0,r.jsxs)("pre",{className:"flex justify-between",children:[(0,r.jsx)(m.Z,{children:e.model_group}),(0,r.jsx)(k.Z,{title:e.model_group,children:(0,r.jsx)(y.Z,{onClick:()=>G(e.model_group),style:{cursor:"pointer",marginRight:"10px"}})})]}),(0,r.jsxs)("div",{className:"my-5",children:[(0,r.jsxs)(w.Z,{children:["Mode: ",e.mode]}),(0,r.jsxs)(w.Z,{children:["Supports Function Calling:"," ",(null==e?void 0:e.supports_function_calling)==!0?"Yes":"No"]}),(0,r.jsxs)(w.Z,{children:["Supports Vision:"," ",(null==e?void 0:e.supports_vision)==!0?"Yes":"No"]}),(0,r.jsxs)(w.Z,{children:["Max Input Tokens:"," ",(null==e?void 0:e.max_input_tokens)?null==e?void 0:e.max_input_tokens:"N/A"]}),(0,r.jsxs)(w.Z,{children:["Max Output Tokens:"," ",(null==e?void 0:e.max_output_tokens)?null==e?void 0:e.max_output_tokens:"N/A"]})]}),(0,r.jsx)("div",{style:{marginTop:"auto",textAlign:"right"},children:(0,r.jsxs)("a",{href:"#",onClick:()=>O(e),style:{color:"#1890ff",fontSize:"smaller"},children:["View more ",(0,r.jsx)(f.Z,{})]})})]},e.model_group))})]}):(0,r.jsxs)(l.Z,{className:"mx-auto max-w-xl mt-10",children:[(0,r.jsx)(w.Z,{className:"text-xl text-center mb-2 text-black",children:"Public Model Hub not enabled."}),(0,r.jsx)("p",{className:"text-base text-center text-slate-800",children:"Ask your proxy admin to enable this on their Admin UI."})]}),(0,r.jsx)(g.Z,{title:"Public Model Hub",width:600,visible:Z,footer:null,onOk:B,onCancel:I,children:(0,r.jsxs)("div",{className:"pt-5 pb-5",children:[(0,r.jsxs)("div",{className:"flex justify-between mb-4",children:[(0,r.jsx)(w.Z,{className:"text-base mr-2",children:"Shareable Link:"}),(0,r.jsx)(w.Z,{className:"max-w-sm ml-2 bg-gray-200 pr-2 pl-2 pt-1 pb-1 text-center rounded",children:"/ui/model_hub?key="})]}),(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsx)(c.Z,{onClick:()=>{S.replace("/model_hub?key=".concat(o))},children:"See Page"})})]})}),(0,r.jsx)(g.Z,{title:C&&C.model_group?C.model_group:"Unknown Model",width:800,visible:P,footer:null,onOk:B,onCancel:I,children:C&&(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-4",children:(0,r.jsx)("strong",{children:"Model Information & Usage"})}),(0,r.jsxs)(d.Z,{children:[(0,r.jsxs)(h.Z,{children:[(0,r.jsx)(i.Z,{children:"OpenAI Python SDK"}),(0,r.jsx)(i.Z,{children:"Supported OpenAI Params"}),(0,r.jsx)(i.Z,{children:"LlamaIndex"}),(0,r.jsx)(i.Z,{children:"Langchain Py"})]}),(0,r.jsxs)(u.Z,{children:[(0,r.jsx)(p.Z,{children:(0,r.jsx)(j.Z,{language:"python",children:'\nimport openai\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="http://0.0.0.0:4000" # LiteLLM Proxy is OpenAI compatible, Read More: https://docs.litellm.ai/docs/proxy/user_keys\n)\n\nresponse = client.chat.completions.create(\n model="'.concat(C.model_group,'", # model to send to the proxy\n messages = [\n {\n "role": "user",\n "content": "this is a test request, write a short poem"\n }\n ]\n)\n\nprint(response)\n ')})}),(0,r.jsx)(p.Z,{children:(0,r.jsx)(j.Z,{language:"python",children:"".concat(null===(t=C.supported_openai_params)||void 0===t?void 0:t.map(e=>"".concat(e,"\n")).join(""))})}),(0,r.jsx)(p.Z,{children:(0,r.jsx)(j.Z,{language:"python",children:'\nimport os, dotenv\n\nfrom llama_index.llms import AzureOpenAI\nfrom llama_index.embeddings import AzureOpenAIEmbedding\nfrom llama_index import VectorStoreIndex, SimpleDirectoryReader, ServiceContext\n\nllm = AzureOpenAI(\n engine="'.concat(C.model_group,'", # model_name on litellm proxy\n temperature=0.0,\n azure_endpoint="http://0.0.0.0:4000", # litellm proxy endpoint\n api_key="sk-1234", # litellm proxy API Key\n api_version="2023-07-01-preview",\n)\n\nembed_model = AzureOpenAIEmbedding(\n deployment_name="azure-embedding-model",\n azure_endpoint="http://0.0.0.0:4000",\n api_key="sk-1234",\n api_version="2023-07-01-preview",\n)\n\n\ndocuments = SimpleDirectoryReader("llama_index_data").load_data()\nservice_context = ServiceContext.from_defaults(llm=llm, embed_model=embed_model)\nindex = VectorStoreIndex.from_documents(documents, service_context=service_context)\n\nquery_engine = index.as_query_engine()\nresponse = query_engine.query("What did the author do growing up?")\nprint(response)\n\n ')})}),(0,r.jsx)(p.Z,{children:(0,r.jsx)(j.Z,{language:"python",children:'\nfrom langchain.chat_models import ChatOpenAI\nfrom langchain.prompts.chat import (\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n SystemMessagePromptTemplate,\n)\nfrom langchain.schema import HumanMessage, SystemMessage\n\nchat = ChatOpenAI(\n openai_api_base="http://0.0.0.0:4000",\n model = "'.concat(C.model_group,'",\n temperature=0.1\n)\n\nmessages = [\n SystemMessage(\n content="You are a helpful assistant that im using to make a test request to."\n ),\n HumanMessage(\n content="test from litellm. tell me why it\'s amazing in 1 sentence"\n ),\n]\nresponse = chat(messages)\n\nprint(response)\n\n ')})})]})]})]})})]})}},777:function(e,t,o){o.d(t,{AZ:function(){return k},Au:function(){return O},BL:function(){return L},Br:function(){return m},E9:function(){return K},EY:function(){return Q},FC:function(){return A},Gh:function(){return R},HK:function(){return P},I1:function(){return u},J$:function(){return E},K_:function(){return X},N8:function(){return T},NV:function(){return l},Nc:function(){return J},O3:function(){return q},OU:function(){return C},Og:function(){return c},Ov:function(){return p},Qy:function(){return f},RQ:function(){return d},Rg:function(){return x},So:function(){return b},Xd:function(){return B},Xm:function(){return y},YU:function(){return Y},Zr:function(){return i},ao:function(){return W},b1:function(){return F},cu:function(){return V},e2:function(){return z},fP:function(){return _},hT:function(){return G},hy:function(){return s},jA:function(){return D},jE:function(){return H},kK:function(){return n},kn:function(){return g},lg:function(){return I},mR:function(){return N},o6:function(){return j},pf:function(){return U},qm:function(){return a},rs:function(){return w},tN:function(){return Z},um:function(){return M},wX:function(){return h},wd:function(){return v},xA:function(){return S}});var r=o(80588);let a=async()=>{try{let e=await fetch("https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json"),t=await e.json();return console.log("received data: ".concat(t)),t}catch(e){throw console.error("Failed to get model cost map:",e),e}},n=async(e,t)=>{try{let o=await fetch("/model/new",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!o.ok){let e=await o.text();throw r.ZP.error("Failed to create key: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let a=await o.json();return console.log("API Response:",a),r.ZP.success("Model created successfully. Wait 60s and refresh on 'All Models' page"),a}catch(e){throw console.error("Failed to create key:",e),e}},s=async e=>{try{let t=await fetch("/model/settings",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await t.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},c=async(e,t)=>{console.log("model_id in model delete call: ".concat(t));try{let o=await fetch("/model/delete",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({id:t})});if(!o.ok){let e=await o.text();throw r.ZP.error("Failed to create key: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let a=await o.json();return console.log("API Response:",a),r.ZP.success("Model deleted successfully. Restart server to see this."),a}catch(e){throw console.error("Failed to create key:",e),e}},l=async(e,t)=>{if(console.log("budget_id in budget delete call: ".concat(t)),null!=e)try{let o=await fetch("/budget/delete",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({id:t})});if(!o.ok){let e=await o.text();throw r.ZP.error("Failed to create key: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let a=await o.json();return console.log("API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},i=async(e,t)=>{try{console.log("Form Values in budgetCreateCall:",t),console.log("Form Values after check:",t);let o=await fetch("/budget/new",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!o.ok){let e=await o.text();throw r.ZP.error("Failed to create key: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let a=await o.json();return console.log("API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},d=async e=>{try{let t=await fetch("/alerting/settings",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await t.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},h=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.metadata){console.log("formValues.metadata:",o.metadata);try{o.metadata=JSON.parse(o.metadata)}catch(e){throw r.ZP.error("Failed to parse metadata: "+e,10),Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",o);let a=await fetch("/key/generate",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...o})});if(!a.ok){let e=await a.text();throw r.ZP.error("Failed to create key: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await a.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},p=async(e,t,o)=>{try{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.metadata){console.log("formValues.metadata:",o.metadata);try{o.metadata=JSON.parse(o.metadata)}catch(e){throw r.ZP.error("Failed to parse metadata: "+e,10),Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",o);let a=await fetch("/user/new",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...o})});if(!a.ok){let e=await a.text();throw r.ZP.error("Failed to create key: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await a.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},u=async(e,t)=>{try{console.log("in keyDeleteCall:",t);let o=await fetch("/key/delete",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({keys:[t]})});if(!o.ok){let e=await o.text();throw r.ZP.error("Failed to delete key: "+e,10),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},w=async(e,t)=>{try{console.log("in teamDeleteCall:",t);let o=await fetch("/team/delete",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_ids:[t]})});if(!o.ok){let e=await o.text();throw r.ZP.error("Failed to delete team: "+e,10),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to delete key:",e),e}},m=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0;try{let c="/user/info";"App Owner"==o&&t&&(c="".concat(c,"?user_id=").concat(t)),"App User"==o&&t&&(c="".concat(c,"?user_id=").concat(t)),console.log("in userInfoCall viewAll=",a),a&&s&&null!=n&&void 0!=n&&(c="".concat(c,"?view_all=true&page=").concat(n,"&page_size=").concat(s));let l=await fetch(c,{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let i=await l.json();return console.log("API Response:",i),i}catch(e){throw console.error("Failed to create key:",e),e}},y=async(e,t)=>{try{let o="/team/info";t&&(o="".concat(o,"?team_id=").concat(t)),console.log("in teamInfoCall");let a=await fetch(o,{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let n=await a.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},f=async e=>{try{let t=await fetch("/global/spend",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await t.json()}catch(e){throw console.error("Failed to create key:",e),e}},k=async(e,t,o)=>{try{let t=await fetch("/v2/model/info",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let o=await t.json();return console.log("modelInfoCall:",o),o}catch(e){throw console.error("Failed to create key:",e),e}},g=async e=>{try{let t=await fetch("/model_group/info",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let o=await t.json();return console.log("modelHubCall:",o),o}catch(e){throw console.error("Failed to create key:",e),e}},j=async(e,t,o,a,n,s)=>{try{let t="/model/metrics";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(n,"&endTime=").concat(s));let o=await fetch(t,{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},x=async(e,t,o,a)=>{try{let n="/model/streaming_metrics";t&&(n="".concat(n,"?_selected_model_group=").concat(t,"&startTime=").concat(o,"&endTime=").concat(a));let s=await fetch(n,{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!s.ok){let e=await s.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await s.json()}catch(e){throw console.error("Failed to create key:",e),e}},_=async(e,t,o,a,n,s)=>{try{let t="/model/metrics/slow_responses";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(n,"&endTime=").concat(s));let o=await fetch(t,{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},T=async(e,t,o,a,n,s)=>{try{let t="/model/metrics/exceptions";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(n,"&endTime=").concat(s));let o=await fetch(t,{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},b=async(e,t,o)=>{try{let t=await fetch("/models",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await t.json()}catch(e){throw console.error("Failed to create key:",e),e}},N=async e=>{try{let t="/global/spend/teams";console.log("in teamSpendLogsCall:",t);let o=await fetch("".concat(t),{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},E=async(e,t,o)=>{try{let r="/global/spend/tags";t&&o&&(r="".concat(r,"?start_date=").concat(t,"&end_date=").concat(o)),console.log("in tagsSpendLogsCall:",r);let a=await fetch("".concat(r),{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok)throw await a.text(),Error("Network response was not ok");let n=await a.json();return console.log(n),n}catch(e){throw console.error("Failed to create key:",e),e}},P=async(e,t,o,a,n,s)=>{try{console.log("user role in spend logs call: ".concat(o));let t="/spend/logs";t="App Owner"==o?"".concat(t,"?user_id=").concat(a,"&start_date=").concat(n,"&end_date=").concat(s):"".concat(t,"?start_date=").concat(n,"&end_date=").concat(s);let c=await fetch(t,{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!c.ok){let e=await c.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let l=await c.json();return console.log(l),l}catch(e){throw console.error("Failed to create key:",e),e}},A=async e=>{try{let t=await fetch("/global/spend/logs",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let o=await t.json();return console.log(o),o}catch(e){throw console.error("Failed to create key:",e),e}},Z=async e=>{try{let t=await fetch("/global/spend/keys?limit=5",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let o=await t.json();return console.log(o),o}catch(e){throw console.error("Failed to create key:",e),e}},F=async(e,t,o,a)=>{try{let n="";n=t?JSON.stringify({api_key:t,startTime:o,endTime:a}):JSON.stringify({startTime:o,endTime:a});let s={method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}};s.body=n;let c=await fetch("/global/spend/end_users",s);if(!c.ok){let e=await c.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let l=await c.json();return console.log(l),l}catch(e){throw console.error("Failed to create key:",e),e}},C=async(e,t,o,a)=>{try{let n="/global/spend/provider";o&&a&&(n+="?start_date=".concat(o,"&end_date=").concat(a)),t&&(n+="&api_key=".concat(t));let s=await fetch(n,{method:"GET",headers:{Authorization:"Bearer ".concat(e)}});if(!s.ok){let e=await s.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let c=await s.json();return console.log(c),c}catch(e){throw console.error("Failed to fetch spend data:",e),e}},v=async(e,t,o)=>{try{let r="/global/activity";t&&o&&(r+="?start_date=".concat(t,"&end_date=").concat(o));let a=await fetch(r,{method:"GET",headers:{Authorization:"Bearer ".concat(e)}});if(!a.ok)throw await a.text(),Error("Network response was not ok");let n=await a.json();return console.log(n),n}catch(e){throw console.error("Failed to fetch spend data:",e),e}},S=async(e,t,o)=>{try{let r="/global/activity/model";t&&o&&(r+="?start_date=".concat(t,"&end_date=").concat(o));let a=await fetch(r,{method:"GET",headers:{Authorization:"Bearer ".concat(e)}});if(!a.ok)throw await a.text(),Error("Network response was not ok");let n=await a.json();return console.log(n),n}catch(e){throw console.error("Failed to fetch spend data:",e),e}},O=async e=>{try{let t=await fetch("/global/spend/models?limit=5",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let o=await t.json();return console.log(o),o}catch(e){throw console.error("Failed to create key:",e),e}},z=async(e,t)=>{try{let o=await fetch("/v2/key/info",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({keys:t})});if(!o.ok){let e=await o.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},B=async(e,t)=>{try{let o="/user/get_users?role=".concat(t);console.log("in userGetAllUsersCall:",o);let a=await fetch(o,{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw r.ZP.error("Failed to delete key: "+e,10),Error("Network response was not ok")}let n=await a.json();return console.log(n),n}catch(e){throw console.error("Failed to get requested models:",e),e}},I=async e=>{try{let t=await fetch("/user/available_roles",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok)throw await t.text(),Error("Network response was not ok");let o=await t.json();return console.log("response from user/available_role",o),o}catch(e){throw e}},G=async(e,t)=>{try{console.log("Form Values in teamCreateCall:",t);let o=await fetch("/team/new",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!o.ok){let e=await o.text();throw r.ZP.error("Failed to create key: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let a=await o.json();return console.log("API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},J=async(e,t)=>{try{console.log("Form Values in keyUpdateCall:",t);let o=await fetch("/key/update",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!o.ok){let e=await o.text();throw r.ZP.error("Failed to update key: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let a=await o.json();return console.log("Update key Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},R=async(e,t)=>{try{console.log("Form Values in teamUpateCall:",t);let o=await fetch("/team/update",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!o.ok){let e=await o.text();throw r.ZP.error("Failed to update team: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let a=await o.json();return console.log("Update Team Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},M=async(e,t)=>{try{console.log("Form Values in modelUpateCall:",t);let o=await fetch("/model/update",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!o.ok){let e=await o.text();throw r.ZP.error("Failed to update model: "+e,10),console.error("Error update from the server:",e),Error("Network response was not ok")}let a=await o.json();return console.log("Update model Response:",a),a}catch(e){throw console.error("Failed to update model:",e),e}},V=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let a=await fetch("/team/member_add",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,member:o})});if(!a.ok){let e=await a.text();throw r.ZP.error("Failed to create key: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await a.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},U=async(e,t,o)=>{try{console.log("Form Values in userUpdateUserCall:",t);let a={...t};null!==o&&(a.user_role=o),a=JSON.stringify(a);let n=await fetch("/user/update",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:a});if(!n.ok){let e=await n.text();throw r.ZP.error("Failed to create key: "+e,10),console.error("Error response from the server:",e),Error("Network response was not ok")}let s=await n.json();return console.log("API Response:",s),s}catch(e){throw console.error("Failed to create key:",e),e}},H=async(e,t)=>{try{let o="/health/services?service=".concat(t);console.log("Checking Slack Budget Alerts service health");let a=await fetch(o,{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw r.ZP.error("Failed ".concat(t," service health check ")+e),Error(e)}let n=await a.json();return r.ZP.success("Test request to ".concat(t," made - check logs/alerts on ").concat(t," to verify")),n}catch(e){throw console.error("Failed to perform health check:",e),e}},q=async e=>{try{let t=await fetch("/budget/list",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await t.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},L=async(e,t,o)=>{try{let t=await fetch("/get/config/callbacks",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await t.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},Y=async e=>{try{let t=await fetch("/config/list?config_type=general_settings",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await t.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},K=async(e,t)=>{try{let o=await fetch("/config/field/info?field_name=".concat(t),{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");return await o.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},D=async(e,t,o)=>{try{let a=await fetch("/config/field/update",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,field_value:o,config_type:"general_settings"})});if(!a.ok){let e=await a.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let n=await a.json();return r.ZP.success("Successfully updated value!"),n}catch(e){throw console.error("Failed to set callbacks:",e),e}},W=async(e,t)=>{try{let o=await fetch("/config/field/delete",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,config_type:"general_settings"})});if(!o.ok){let e=await o.text();throw r.ZP.error(e,10),Error("Network response was not ok")}let a=await o.json();return r.ZP.success("Field reset on proxy"),a}catch(e){throw console.error("Failed to get callbacks:",e),e}},X=async(e,t)=>{try{let o=await fetch("/config/update",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!o.ok){let e=await o.text();throw r.ZP.error(e,10),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},Q=async e=>{try{let t=await fetch("/health",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e=await t.text();throw r.ZP.error(e),Error("Network response was not ok")}return await t.json()}catch(e){throw console.error("Failed to call /health:",e),e}}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/359-15429935a96e2644.js b/litellm/proxy/_experimental/out/_next/static/chunks/359-15429935a96e2644.js deleted file mode 100644 index d40aa7e636..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/359-15429935a96e2644.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[359],{12215:function(e,t,n){n.d(t,{iN:function(){return b},R_:function(){return d},EV:function(){return m},ez:function(){return p}});var r=n(41785),a=n(76991),o=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function i(e){var t=e.r,n=e.g,a=e.b,o=(0,r.py)(t,n,a);return{h:360*o.h,s:o.s,v:o.v}}function s(e){var t=e.r,n=e.g,a=e.b;return"#".concat((0,r.vq)(t,n,a,!1))}function l(e,t,n){var r;return(r=Math.round(e.h)>=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 c(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),Number(r.toFixed(2)))}function u(e,t,n){var r;return(r=n?e.v+.05*t:e.v-.15*t)>1&&(r=1),Number(r.toFixed(2))}function d(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=(0,a.uA)(e),d=5;d>0;d-=1){var p=i(r),f=s((0,a.uA)({h:l(p,d,!0),s:c(p,d,!0),v:u(p,d,!0)}));n.push(f)}n.push(s(r));for(var g=1;g<=4;g+=1){var m=i(r),b=s((0,a.uA)({h:l(m,g),s:c(m,g),v:u(m,g)}));n.push(b)}return"dark"===t.theme?o.map(function(e){var r,o,i,l=e.index,c=e.opacity;return s((r=(0,a.uA)(t.backgroundColor||"#141414"),o=(0,a.uA)(n[l]),i=100*c/100,{r:(o.r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b}))}):n}var p={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"},f={},g={};Object.keys(p).forEach(function(e){f[e]=d(p[e]),f[e].primary=f[e][5],g[e]=d(p[e],{theme:"dark",backgroundColor:"#141414"}),g[e].primary=g[e][5]}),f.red,f.volcano;var m=f.gold;f.orange,f.yellow,f.lime,f.green,f.cyan;var b=f.blue;f.geekblue,f.purple,f.magenta,f.grey,f.grey},8985:function(e,t,n){n.d(t,{E4:function(){return eF},jG:function(){return C},ks:function(){return G},bf:function(){return U},CI:function(){return eM},fp:function(){return X},xy:function(){return eP}});var r,a,o=n(50833),i=n(80406),s=n(63787),l=n(5239),c=function(e){for(var t,n=0,r=0,a=e.length;a>=4;++r,a-=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(a){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)},u=n(24050),d=n(64090),p=n.t(d,2);n(61475),n(92536);var f=n(47365),g=n(65127);function m(e){return e.join("%")}var b=function(){function e(t){(0,f.Z)(this,e),(0,o.Z)(this,"instanceId",void 0),(0,o.Z)(this,"cache",new Map),this.instanceId=t}return(0,g.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}(),h="data-token-hash",y="data-css-hash",E="__cssinjs_instance__",v=d.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(y,"]"))||[],n=document.head.firstChild;Array.from(t).forEach(function(t){t[E]=t[E]||e,t[E]===e&&document.head.insertBefore(t,n)});var r={};Array.from(document.querySelectorAll("style[".concat(y,"]"))).forEach(function(t){var n,a=t.getAttribute(y);r[a]?t[E]===e&&(null===(n=t.parentNode)||void 0===n||n.removeChild(t)):r[a]=!0})}return new b(e)}(),defaultCache:!0}),S=n(6976),T=n(22127),w=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,g.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],a={map:this.cache};return e.forEach(function(e){if(a){var t;a=null===(t=a)||void 0===t||null===(t=t.map)||void 0===t?void 0:t.get(e)}else a=void 0}),null!==(t=a)&&void 0!==t&&t.value&&r&&(a.value[1]=this.cacheCallTimes++),null===(n=a)||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 a=this.keys.reduce(function(e,t){var n=(0,i.Z)(e,2)[1];return r.internalGet(t)[1]0,"[Ant Design CSS-in-JS] Theme should have at least one derivative function."),k+=1}return(0,g.Z)(e,[{key:"getDerivativeToken",value:function(e){return this.derivatives.reduce(function(t,n){return n(e,t)},void 0)}}]),e}(),x=new w;function C(e){var t=Array.isArray(e)?e:[e];return x.has(t)||x.set(t,new R(t)),x.get(t)}var N=new WeakMap,I={},_=new WeakMap;function O(e){var t=_.get(e)||"";return t||(Object.keys(e).forEach(function(n){var r=e[n];t+=n,r instanceof R?t+=r.id:r&&"object"===(0,S.Z)(r)?t+=O(r):t+=r}),_.set(e,t)),t}function L(e,t){return c("".concat(t,"_").concat(O(e)))}var P="random-".concat(Date.now(),"-").concat(Math.random()).replace(/\./g,""),D="_bAmBoO_",M=void 0,F=(0,T.Z)();function U(e){return"number"==typeof e?"".concat(e,"px"):e}function B(e,t,n){var r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(i)return e;var s=(0,l.Z)((0,l.Z)({},a),{},(r={},(0,o.Z)(r,h,t),(0,o.Z)(r,y,n),r)),c=Object.keys(s).map(function(e){var t=s[e];return t?"".concat(e,'="').concat(t,'"'):null}).filter(function(e){return e}).join(" ");return"")}var G=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()},Z=function(e,t,n){var r,a={},o={};return Object.entries(e).forEach(function(e){var t=(0,i.Z)(e,2),r=t[0],s=t[1];if(null!=n&&null!==(l=n.preserve)&&void 0!==l&&l[r])o[r]=s;else if(("string"==typeof s||"number"==typeof s)&&!(null!=n&&null!==(c=n.ignore)&&void 0!==c&&c[r])){var l,c,u,d=G(r,null==n?void 0:n.prefix);a[d]="number"!=typeof s||null!=n&&null!==(u=n.unitless)&&void 0!==u&&u[r]?String(s):"".concat(s,"px"),o[r]="var(".concat(d,")")}}),[o,(r={scope:null==n?void 0:n.scope},Object.keys(a).length?".".concat(t).concat(null!=r&&r.scope?".".concat(r.scope):"","{").concat(Object.entries(a).map(function(e){var t=(0,i.Z)(e,2),n=t[0],r=t[1];return"".concat(n,":").concat(r,";")}).join(""),"}"):"")]},j=n(24800),$=(0,l.Z)({},p).useInsertionEffect,z=$?function(e,t,n){return $(function(){return e(),t()},n)}:function(e,t,n){d.useMemo(e,n),(0,j.Z)(function(){return t(!0)},n)},H=void 0!==(0,l.Z)({},p).useInsertionEffect?function(e){var t=[],n=!1;return d.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 V(e,t,n,r,a){var o=d.useContext(v).cache,l=m([e].concat((0,s.Z)(t))),c=H([l]),u=function(e){o.opUpdate(l,function(t){var r=(0,i.Z)(t||[void 0,void 0],2),a=r[0],o=[void 0===a?0:a,r[1]||n()];return e?e(o):o})};d.useMemo(function(){u()},[l]);var p=o.opGet(l)[1];return z(function(){null==a||a(p)},function(e){return u(function(t){var n=(0,i.Z)(t,2),r=n[0],o=n[1];return e&&0===r&&(null==a||a(p)),[r+1,o]}),function(){o.opUpdate(l,function(t){var n=(0,i.Z)(t||[],2),a=n[0],s=void 0===a?0:a,u=n[1];return 0==s-1?(c(function(){(e||!o.opGet(l))&&(null==r||r(u,!1))}),null):[s-1,u]})}},[l]),p}var W={},q=new Map,Y=function(e,t,n,r){var a=n.getDerivativeToken(e),o=(0,l.Z)((0,l.Z)({},a),t);return r&&(o=r(o)),o},K="token";function X(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(0,d.useContext)(v),a=r.cache.instanceId,o=r.container,p=n.salt,f=void 0===p?"":p,g=n.override,m=void 0===g?W:g,b=n.formatToken,S=n.getComputedToken,T=n.cssVar,w=function(e,t){for(var n=N,r=0;r=(q.get(e)||0)}),n.length-r.length>0&&r.forEach(function(e){"undefined"!=typeof document&&document.querySelectorAll("style[".concat(h,'="').concat(e,'"]')).forEach(function(e){if(e[E]===a){var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)}}),q.delete(e)})},function(e){var t=(0,i.Z)(e,4),n=t[0],r=t[3];if(T&&r){var s=(0,u.hq)(r,c("css-variables-".concat(n._themeKey)),{mark:y,prepend:"queue",attachTo:o,priority:-999});s[E]=a,s.setAttribute(h,n._themeKey)}})}var Q=n(14749),J={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},ee="comm",et="rule",en="decl",er=Math.abs,ea=String.fromCharCode;function eo(e,t,n){return e.replace(t,n)}function ei(e,t){return 0|e.charCodeAt(t)}function es(e,t,n){return e.slice(t,n)}function el(e){return e.length}function ec(e,t){return t.push(e),e}function eu(e,t){for(var n="",r=0;r0?f[y]+" "+E:eo(E,/&\f/g,f[y])).trim())&&(l[h++]=v);return ey(e,t,n,0===a?et:s,l,c,u,d)}function eA(e,t,n,r,a){return ey(e,t,n,en,es(e,0,r),es(e,r+1,-1),r,a)}var ek="data-ant-cssinjs-cache-path",eR="_FILE_STYLE__",ex=!0,eC="_multi_value_";function eN(e){var t,n,r;return eu((r=function e(t,n,r,a,o,i,s,l,c){for(var u,d,p,f=0,g=0,m=s,b=0,h=0,y=0,E=1,v=1,S=1,T=0,w="",A=o,k=i,R=a,x=w;v;)switch(y=T,T=eE()){case 40:if(108!=y&&58==ei(x,m-1)){-1!=(d=x+=eo(eT(T),"&","&\f"),p=er(f?l[f-1]:0),d.indexOf("&\f",p))&&(S=-1);break}case 34:case 39:case 91:x+=eT(T);break;case 9:case 10:case 13:case 32:x+=function(e){for(;eb=ev();)if(eb<33)eE();else break;return eS(e)>2||eS(eb)>3?"":" "}(y);break;case 92:x+=function(e,t){for(var n;--t&&eE()&&!(eb<48)&&!(eb>102)&&(!(eb>57)||!(eb<65))&&(!(eb>70)||!(eb<97)););return n=em+(t<6&&32==ev()&&32==eE()),es(eh,e,n)}(em-1,7);continue;case 47:switch(ev()){case 42:case 47:ec(ey(u=function(e,t){for(;eE();)if(e+eb===57)break;else if(e+eb===84&&47===ev())break;return"/*"+es(eh,t,em-1)+"*"+ea(47===e?e:eE())}(eE(),em),n,r,ee,ea(eb),es(u,2,-2),0,c),c);break;default:x+="/"}break;case 123*E:l[f++]=el(x)*S;case 125*E:case 59:case 0:switch(T){case 0:case 125:v=0;case 59+g:-1==S&&(x=eo(x,/\f/g,"")),h>0&&el(x)-m&&ec(h>32?eA(x+";",a,r,m-1,c):eA(eo(x," ","")+";",a,r,m-2,c),c);break;case 59:x+=";";default:if(ec(R=ew(x,n,r,f,g,o,l,w,A=[],k=[],m,i),i),123===T){if(0===g)e(x,n,R,R,A,i,m,l,k);else switch(99===b&&110===ei(x,3)?100:b){case 100:case 108:case 109:case 115:e(t,R,R,a&&ec(ew(t,R,R,0,0,o,l,w,o,A=[],m,k),k),o,k,m,l,a?A:k);break;default:e(x,R,R,R,[""],k,0,l,k)}}}f=g=h=0,E=S=1,w=x="",m=s;break;case 58:m=1+el(x),h=y;default:if(E<1){if(123==T)--E;else if(125==T&&0==E++&&125==(eb=em>0?ei(eh,--em):0,ef--,10===eb&&(ef=1,ep--),eb))continue}switch(x+=ea(T),T*E){case 38:S=g>0?1:(x+="\f",-1);break;case 44:l[f++]=(el(x)-1)*S,S=1;break;case 64:45===ev()&&(x+=eT(eE())),b=ev(),g=m=el(w=x+=function(e){for(;!eS(ev());)eE();return es(eh,e,em)}(em)),T++;break;case 45:45===y&&2==el(x)&&(E=0)}}return i}("",null,null,null,[""],(n=t=e,ep=ef=1,eg=el(eh=n),em=0,t=[]),0,[0],t),eh="",r),ed).replace(/\{%%%\:[^;];}/g,";")}var eI=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:[]},a=r.root,o=r.injectHash,c=r.parentSelectors,d=n.hashId,p=n.layer,f=(n.path,n.hashPriority),g=n.transformers,m=void 0===g?[]:g;n.linters;var b="",h={};function y(t){var r=t.getName(d);if(!h[r]){var a=e(t.style,n,{root:!1,parentSelectors:c}),o=(0,i.Z)(a,1)[0];h[r]="@keyframes ".concat(t.getName(d)).concat(o)}}if((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||a?t:{};if("string"==typeof r)b+="".concat(r,"\n");else if(r._keyframe)y(r);else{var u=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(u).forEach(function(t){var r=u[t];if("object"!==(0,S.Z)(r)||!r||"animationName"===t&&r._keyframe||"object"===(0,S.Z)(r)&&r&&("_skip_check_"in r||eC in r)){function p(e,t){var n=e.replace(/[A-Z]/g,function(e){return"-".concat(e.toLowerCase())}),r=t;J[e]||"number"!=typeof r||0===r||(r="".concat(r,"px")),"animationName"===e&&null!=t&&t._keyframe&&(y(t),r=t.getName(d)),b+="".concat(n,":").concat(r,";")}var g,m=null!==(g=null==r?void 0:r.value)&&void 0!==g?g:r;"object"===(0,S.Z)(r)&&null!=r&&r[eC]&&Array.isArray(m)?m.forEach(function(e){p(t,e)}):p(t,m)}else{var E=!1,v=t.trim(),T=!1;(a||o)&&d?v.startsWith("@")?E=!0:v=function(e,t,n){if(!t)return e;var r=".".concat(t),a="low"===n?":where(".concat(r,")"):r;return e.split(",").map(function(e){var t,n=e.trim().split(/\s+/),r=n[0]||"",o=(null===(t=r.match(/^\w+/))||void 0===t?void 0:t[0])||"";return[r="".concat(o).concat(a).concat(r.slice(o.length))].concat((0,s.Z)(n.slice(1))).join(" ")}).join(",")}(t,d,f):a&&!d&&("&"===v||""===v)&&(v="",T=!0);var w=e(r,n,{root:T,injectHash:E,parentSelectors:[].concat((0,s.Z)(c),[v])}),A=(0,i.Z)(w,2),k=A[0],R=A[1];h=(0,l.Z)((0,l.Z)({},h),R),b+="".concat(v).concat(k)}})}}),a){if(p&&(void 0===M&&(M=function(e,t,n){if((0,T.Z)()){(0,u.hq)(e,P);var r,a,o=document.createElement("div");o.style.position="fixed",o.style.left="0",o.style.top="0",null==t||t(o),document.body.appendChild(o);var i=n?n(o):null===(r=getComputedStyle(o).content)||void 0===r?void 0:r.includes(D);return null===(a=o.parentNode)||void 0===a||a.removeChild(o),(0,u.jL)(P),i}return!1}("@layer ".concat(P," { .").concat(P,' { content: "').concat(D,'"!important; } }'),function(e){e.className=P})),M)){var E=p.split(","),v=E[E.length-1].trim();b="@layer ".concat(v," {").concat(b,"}"),E.length>1&&(b="@layer ".concat(p,"{%%%:%}").concat(b))}}else b="{".concat(b,"}");return[b,h]};function e_(e,t){return c("".concat(e.join("%")).concat(t))}function eO(){return null}var eL="style";function eP(e,t){var n=e.token,a=e.path,l=e.hashId,c=e.layer,p=e.nonce,f=e.clientOnly,g=e.order,m=void 0===g?0:g,b=d.useContext(v),S=b.autoClear,w=(b.mock,b.defaultCache),A=b.hashPriority,k=b.container,R=b.ssrInline,x=b.transformers,C=b.linters,N=b.cache,I=n._tokenKey,_=[I].concat((0,s.Z)(a)),O=V(eL,_,function(){var e=_.join("|");if(!function(){if(!r&&(r={},(0,T.Z)())){var e,t=document.createElement("div");t.className=ek,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,i.Z)(t,2),a=n[0],o=n[1];r[a]=o});var a=document.querySelector("style[".concat(ek,"]"));a&&(ex=!1,null===(e=a.parentNode)||void 0===e||e.removeChild(a)),document.body.removeChild(t)}}(),r[e]){var n=function(e){var t=r[e],n=null;if(t&&(0,T.Z)()){if(ex)n=eR;else{var a=document.querySelector("style[".concat(y,'="').concat(r[e],'"]'));a?n=a.innerHTML:delete r[e]}}return[n,t]}(e),o=(0,i.Z)(n,2),s=o[0],u=o[1];if(s)return[s,I,u,{},f,m]}var d=eI(t(),{hashId:l,hashPriority:A,layer:c,path:a.join("-"),transformers:x,linters:C}),p=(0,i.Z)(d,2),g=p[0],b=p[1],h=eN(g),E=e_(_,h);return[h,I,E,b,f,m]},function(e,t){var n=(0,i.Z)(e,3)[2];(t||S)&&F&&(0,u.jL)(n,{mark:y})},function(e){var t=(0,i.Z)(e,4),n=t[0],r=(t[1],t[2]),a=t[3];if(F&&n!==eR){var o={mark:y,prepend:"queue",attachTo:k,priority:m},s="function"==typeof p?p():p;s&&(o.csp={nonce:s});var l=(0,u.hq)(n,r,o);l[E]=N.instanceId,l.setAttribute(h,I),Object.keys(a).forEach(function(e){(0,u.hq)(eN(a[e]),"_effect-".concat(e),o)})}}),L=(0,i.Z)(O,3),P=L[0],D=L[1],M=L[2];return function(e){var t,n;return t=R&&!F&&w?d.createElement("style",(0,Q.Z)({},(n={},(0,o.Z)(n,h,D),(0,o.Z)(n,y,M),n),{dangerouslySetInnerHTML:{__html:P}})):d.createElement(eO,null),d.createElement(d.Fragment,null,t,e)}}var eD="cssVar",eM=function(e,t){var n=e.key,r=e.prefix,a=e.unitless,o=e.ignore,l=e.token,c=e.scope,p=void 0===c?"":c,f=(0,d.useContext)(v),g=f.cache.instanceId,m=f.container,b=l._tokenKey,S=[].concat((0,s.Z)(e.path),[n,p,b]);return V(eD,S,function(){var e=Z(t(),n,{prefix:r,unitless:a,ignore:o,scope:p}),s=(0,i.Z)(e,2),l=s[0],c=s[1],u=e_(S,c);return[l,c,u,n]},function(e){var t=(0,i.Z)(e,3)[2];F&&(0,u.jL)(t,{mark:y})},function(e){var t=(0,i.Z)(e,3),r=t[1],a=t[2];if(r){var o=(0,u.hq)(r,a,{mark:y,prepend:"queue",attachTo:m,priority:-999});o[E]=g,o.setAttribute(h,n)}})};a={},(0,o.Z)(a,eL,function(e,t,n){var r=(0,i.Z)(e,6),a=r[0],o=r[1],s=r[2],l=r[3],c=r[4],u=r[5],d=(n||{}).plain;if(c)return null;var p=a,f={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)};return p=B(a,o,s,f,d),l&&Object.keys(l).forEach(function(e){if(!t[e]){t[e]=!0;var n=eN(l[e]);p+=B(n,o,"_effect-".concat(e),f,d)}}),[u,s,p]}),(0,o.Z)(a,K,function(e,t,n){var r=(0,i.Z)(e,5),a=r[2],o=r[3],s=r[4],l=(n||{}).plain;if(!o)return null;var c=a._tokenKey,u=B(o,s,c,{"data-rc-order":"prependQueue","data-rc-priority":"".concat(-999)},l);return[-999,c,u]}),(0,o.Z)(a,eD,function(e,t,n){var r=(0,i.Z)(e,4),a=r[1],o=r[2],s=r[3],l=(n||{}).plain;if(!a)return null;var c=B(a,s,o,{"data-rc-order":"prependQueue","data-rc-priority":"".concat(-999)},l);return[-999,o,c]});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,g.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 eU(e){return e.notSplit=!0,e}eU(["borderTop","borderBottom"]),eU(["borderTop"]),eU(["borderBottom"]),eU(["borderLeft","borderRight"]),eU(["borderLeft"]),eU(["borderRight"])},60688:function(e,t,n){n.d(t,{Z:function(){return C}});var r=n(14749),a=n(80406),o=n(50833),i=n(60635),s=n(64090),l=n(16480),c=n.n(l),u=n(12215),d=n(67689),p=n(5239),f=n(6976),g=n(24050),m=n(74687),b=n(53850);function h(e){return"object"===(0,f.Z)(e)&&"string"==typeof e.name&&"string"==typeof e.theme&&("object"===(0,f.Z)(e.icon)||"function"==typeof e.icon)}function y(){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 E(e){return(0,u.R_)(e)[0]}function v(e){return e?Array.isArray(e)?e:[e]:[]}var S=function(e){var t=(0,s.useContext)(d.Z),n=t.csp,r=t.prefixCls,a="\n.anticon {\n display: inline-block;\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)),(0,s.useEffect)(function(){var t=e.current,r=(0,m.A)(t);(0,g.hq)(a,"@ant-design-icons",{prepend:!0,csp:n,attachTo:r})},[])},T=["icon","className","onClick","style","primaryColor","secondaryColor"],w={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1},A=function(e){var t,n,r=e.icon,a=e.className,o=e.onClick,l=e.style,c=e.primaryColor,u=e.secondaryColor,d=(0,i.Z)(e,T),f=s.useRef(),g=w;if(c&&(g={primaryColor:c,secondaryColor:u||E(c)}),S(f),t=h(r),n="icon should be icon definiton, but got ".concat(r),(0,b.ZP)(t,"[@ant-design/icons] ".concat(n)),!h(r))return null;var m=r;return m&&"function"==typeof m.icon&&(m=(0,p.Z)((0,p.Z)({},m),{},{icon:m.icon(g.primaryColor,g.secondaryColor)})),function e(t,n,r){return r?s.createElement(t.tag,(0,p.Z)((0,p.Z)({key:n},y(t.attrs)),r),(t.children||[]).map(function(r,a){return e(r,"".concat(n,"-").concat(t.tag,"-").concat(a))})):s.createElement(t.tag,(0,p.Z)({key:n},y(t.attrs)),(t.children||[]).map(function(r,a){return e(r,"".concat(n,"-").concat(t.tag,"-").concat(a))}))}(m.icon,"svg-".concat(m.name),(0,p.Z)((0,p.Z)({className:a,onClick:o,style:l,"data-icon":m.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},d),{},{ref:f}))};function k(e){var t=v(e),n=(0,a.Z)(t,2),r=n[0],o=n[1];return A.setTwoToneColors({primaryColor:r,secondaryColor:o})}A.displayName="IconReact",A.getTwoToneColors=function(){return(0,p.Z)({},w)},A.setTwoToneColors=function(e){var t=e.primaryColor,n=e.secondaryColor;w.primaryColor=t,w.secondaryColor=n||E(t),w.calculated=!!n};var R=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];k(u.iN.primary);var x=s.forwardRef(function(e,t){var n,l=e.className,u=e.icon,p=e.spin,f=e.rotate,g=e.tabIndex,m=e.onClick,b=e.twoToneColor,h=(0,i.Z)(e,R),y=s.useContext(d.Z),E=y.prefixCls,S=void 0===E?"anticon":E,T=y.rootClassName,w=c()(T,S,(n={},(0,o.Z)(n,"".concat(S,"-").concat(u.name),!!u.name),(0,o.Z)(n,"".concat(S,"-spin"),!!p||"loading"===u.name),n),l),k=g;void 0===k&&m&&(k=-1);var x=v(b),C=(0,a.Z)(x,2),N=C[0],I=C[1];return s.createElement("span",(0,r.Z)({role:"img","aria-label":u.name},h,{ref:t,tabIndex:k,onClick:m,className:w}),s.createElement(A,{icon:u,primaryColor:N,secondaryColor:I,style:f?{msTransform:"rotate(".concat(f,"deg)"),transform:"rotate(".concat(f,"deg)")}:void 0}))});x.displayName="AntdIcon",x.getTwoToneColor=function(){var e=A.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor},x.setTwoToneColor=k;var C=x},67689:function(e,t,n){var r=(0,n(64090).createContext)({});t.Z=r},99537:function(e,t,n){n.d(t,{Z:function(){return s}});var r=n(14749),a=n(64090),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 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(60688),s=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:o}))})},77136:function(e,t,n){n.d(t,{Z:function(){return s}});var r=n(14749),a=n(64090),o={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(60688),s=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:o}))})},81303:function(e,t,n){n.d(t,{Z:function(){return s}});var r=n(14749),a=n(64090),o={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(60688),s=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:o}))})},84174:function(e,t,n){n.d(t,{Z:function(){return s}});var r=n(14749),a=n(64090),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},i=n(60688),s=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:o}))})},20653:function(e,t,n){n.d(t,{Z:function(){return s}});var r=n(14749),a=n(64090),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 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(60688),s=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:o}))})},40388:function(e,t,n){n.d(t,{Z:function(){return s}});var r=n(14749),a=n(64090),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 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(60688),s=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:o}))})},66155:function(e,t,n){n.d(t,{Z:function(){return s}});var r=n(14749),a=n(64090),o={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(60688),s=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:o}))})},50459:function(e,t,n){n.d(t,{Z:function(){return s}});var r=n(14749),a=n(64090),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"},i=n(60688),s=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:o}))})},41785:function(e,t,n){n.d(t,{T6:function(){return p},VD:function(){return f},WE:function(){return c},Yt:function(){return g},lC:function(){return o},py:function(){return l},rW:function(){return a},s:function(){return d},ve:function(){return s},vq:function(){return u}});var r=n(27974);function a(e,t,n){return{r:255*(0,r.sh)(e,255),g:255*(0,r.sh)(t,255),b:255*(0,r.sh)(n,255)}}function o(e,t,n){var a=Math.max(e=(0,r.sh)(e,255),t=(0,r.sh)(t,255),n=(0,r.sh)(n,255)),o=Math.min(e,t,n),i=0,s=0,l=(a+o)/2;if(a===o)s=0,i=0;else{var c=a-o;switch(s=l>.5?c/(2-a-o):c/(a+o),a){case e:i=(t-n)/c+(t1&&(n-=1),n<1/6)?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function s(e,t,n){if(e=(0,r.sh)(e,360),t=(0,r.sh)(t,100),n=(0,r.sh)(n,100),0===t)o=n,s=n,a=n;else{var a,o,s,l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;a=i(c,l,e+1/3),o=i(c,l,e),s=i(c,l,e-1/3)}return{r:255*a,g:255*o,b:255*s}}function l(e,t,n){var a=Math.max(e=(0,r.sh)(e,255),t=(0,r.sh)(t,255),n=(0,r.sh)(n,255)),o=Math.min(e,t,n),i=0,s=a-o;if(a===o)i=0;else{switch(a){case e:i=(t-n)/s+(t>16,g:(65280&e)>>8,b:255&e}}},6564:function(e,t,n){n.d(t,{R:function(){return r}});var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},76991:function(e,t,n){n.d(t,{uA:function(){return i}});var r=n(41785),a=n(6564),o=n(27974);function i(e){var t={r:0,g:0,b:0},n=1,i=null,s=null,l=null,c=!1,p=!1;return"string"==typeof e&&(e=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var t=!1;if(a.R[e])e=a.R[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var n=u.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=u.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=u.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=u.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=u.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=u.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=u.hex8.exec(e))?{r:(0,r.VD)(n[1]),g:(0,r.VD)(n[2]),b:(0,r.VD)(n[3]),a:(0,r.T6)(n[4]),format:t?"name":"hex8"}:(n=u.hex6.exec(e))?{r:(0,r.VD)(n[1]),g:(0,r.VD)(n[2]),b:(0,r.VD)(n[3]),format:t?"name":"hex"}:(n=u.hex4.exec(e))?{r:(0,r.VD)(n[1]+n[1]),g:(0,r.VD)(n[2]+n[2]),b:(0,r.VD)(n[3]+n[3]),a:(0,r.T6)(n[4]+n[4]),format:t?"name":"hex8"}:!!(n=u.hex3.exec(e))&&{r:(0,r.VD)(n[1]+n[1]),g:(0,r.VD)(n[2]+n[2]),b:(0,r.VD)(n[3]+n[3]),format:t?"name":"hex"}}(e)),"object"==typeof e&&(d(e.r)&&d(e.g)&&d(e.b)?(t=(0,r.rW)(e.r,e.g,e.b),c=!0,p="%"===String(e.r).substr(-1)?"prgb":"rgb"):d(e.h)&&d(e.s)&&d(e.v)?(i=(0,o.JX)(e.s),s=(0,o.JX)(e.v),t=(0,r.WE)(e.h,i,s),c=!0,p="hsv"):d(e.h)&&d(e.s)&&d(e.l)&&(i=(0,o.JX)(e.s),l=(0,o.JX)(e.l),t=(0,r.ve)(e.h,i,l),c=!0,p="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=(0,o.Yq)(n),{ok:c,format:e.format||p,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var s="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),l="[\\s|\\(]+(".concat(s,")[,|\\s]+(").concat(s,")[,|\\s]+(").concat(s,")\\s*\\)?"),c="[\\s|\\(]+(".concat(s,")[,|\\s]+(").concat(s,")[,|\\s]+(").concat(s,")[,|\\s]+(").concat(s,")\\s*\\)?"),u={CSS_UNIT:new RegExp(s),rgb:RegExp("rgb"+l),rgba:RegExp("rgba"+c),hsl:RegExp("hsl"+l),hsla:RegExp("hsla"+c),hsv:RegExp("hsv"+l),hsva:RegExp("hsva"+c),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function d(e){return!!u.CSS_UNIT.exec(String(e))}},6336:function(e,t,n){n.d(t,{C:function(){return s}});var r=n(41785),a=n(6564),o=n(76991),i=n(27974),s=function(){function e(t,n){if(void 0===t&&(t=""),void 0===n&&(n={}),t instanceof e)return t;"number"==typeof t&&(t=(0,r.Yt)(t)),this.originalInput=t;var a,i=(0,o.uA)(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(a=n.format)&&void 0!==a?a:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return 128>this.getBrightness()},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,r=e.b/255;return .2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=(0,i.Yq)(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){return 0===this.toHsl().s},e.prototype.toHsv=function(){var e=(0,r.py)(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=(0,r.py)(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),a=Math.round(100*e.v);return 1===this.a?"hsv(".concat(t,", ").concat(n,"%, ").concat(a,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(a,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var e=(0,r.lC)(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=(0,r.lC)(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),a=Math.round(100*e.l);return 1===this.a?"hsl(".concat(t,", ").concat(n,"%, ").concat(a,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(a,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(e){return void 0===e&&(e=!1),(0,r.vq)(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){return void 0===e&&(e=!1),(0,r.s)(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toHexShortString=function(e){return void 0===e&&(e=!1),1===this.a?this.toHexString(e):this.toHex8String(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return 1===this.a?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var e=function(e){return"".concat(Math.round(100*(0,i.sh)(e,255)),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*(0,i.sh)(e,255))};return 1===this.a?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+(0,r.vq)(this.r,this.g,this.b,!1),t=0,n=Object.entries(a.R);t=0;return!t&&r&&(e.startsWith("hex")||"name"===e)?"name"===e&&0===this.a?this.toName():this.toRgbString():("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),("hex"===e||"hex6"===e)&&(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=(0,i.V2)(n.l),new e(n)},e.prototype.brighten=function(t){void 0===t&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-(t/100*255)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-(t/100*255)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-(t/100*255)))),new e(n)},e.prototype.darken=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=(0,i.V2)(n.l),new e(n)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=(0,i.V2)(n.s),new e(n)},e.prototype.saturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=(0,i.V2)(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){void 0===n&&(n=50);var r=this.toRgb(),a=new e(t).toRgb(),o=n/100;return new e({r:(a.r-r.r)*o+r.r,g:(a.g-r.g)*o+r.g,b:(a.b-r.b)*o+r.b,a:(a.a-r.a)*o+r.a})},e.prototype.analogous=function(t,n){void 0===t&&(t=6),void 0===n&&(n=30);var r=this.toHsl(),a=360/n,o=[this];for(r.h=(r.h-(a*t>>1)+720)%360;--t;)r.h=(r.h+a)%360,o.push(new e(r));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){void 0===t&&(t=6);for(var n=this.toHsv(),r=n.h,a=n.s,o=n.v,i=[],s=1/t;t--;)i.push(new e({h:r,s:a,v:o})),o=(o+s)%1;return i},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb(),a=n.a+r.a*(1-n.a);return new e({r:(n.r*n.a+r.r*r.a*(1-n.a))/a,g:(n.g*n.a+r.g*r.a*(1-n.a))/a,b:(n.b*n.a+r.b*r.a*(1-n.a))/a,a:a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,a=[this],o=360/t,i=1;iMath.abs(e-t))?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function a(e){return Math.min(1,Math.max(0,e))}function o(e){return(isNaN(e=parseFloat(e))||e<0||e>1)&&(e=1),e}function i(e){return e<=1?"".concat(100*Number(e),"%"):e}function s(e){return 1===e.length?"0"+e:String(e)}n.d(t,{FZ:function(){return s},JX:function(){return i},V2:function(){return a},Yq:function(){return o},sh:function(){return r}})},88804:function(e,t,n){n.d(t,{Z:function(){return E}});var r,a=n(80406),o=n(64090),i=n(89542),s=n(22127);n(53850);var l=n(74084),c=o.createContext(null),u=n(63787),d=n(24800),p=[],f=n(24050);function g(e){var t=e.match(/^(.*)px$/),n=Number(null==t?void 0:t[1]);return Number.isNaN(n)?function(e){if("undefined"==typeof document)return 0;if(void 0===r){var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var n=document.createElement("div"),a=n.style;a.position="absolute",a.top="0",a.left="0",a.pointerEvents="none",a.visibility="hidden",a.width="200px",a.height="150px",a.overflow="hidden",n.appendChild(t),document.body.appendChild(n);var o=t.offsetWidth;n.style.overflow="scroll";var i=t.offsetWidth;o===i&&(i=n.clientWidth),document.body.removeChild(n),r=o-i}return r}():n}var m="rc-util-locker-".concat(Date.now()),b=0,h=!1,y=function(e){return!1!==e&&((0,s.Z)()&&e?"string"==typeof e?document.querySelector(e):"function"==typeof e?e():e:null)},E=o.forwardRef(function(e,t){var n,r,E,v,S=e.open,T=e.autoLock,w=e.getContainer,A=(e.debug,e.autoDestroy),k=void 0===A||A,R=e.children,x=o.useState(S),C=(0,a.Z)(x,2),N=C[0],I=C[1],_=N||S;o.useEffect(function(){(k||S)&&I(S)},[S,k]);var O=o.useState(function(){return y(w)}),L=(0,a.Z)(O,2),P=L[0],D=L[1];o.useEffect(function(){var e=y(w);D(null!=e?e:null)});var M=function(e,t){var n=o.useState(function(){return(0,s.Z)()?document.createElement("div"):null}),r=(0,a.Z)(n,1)[0],i=o.useRef(!1),l=o.useContext(c),f=o.useState(p),g=(0,a.Z)(f,2),m=g[0],b=g[1],h=l||(i.current?void 0:function(e){b(function(t){return[e].concat((0,u.Z)(t))})});function y(){r.parentElement||document.body.appendChild(r),i.current=!0}function E(){var e;null===(e=r.parentElement)||void 0===e||e.removeChild(r),i.current=!1}return(0,d.Z)(function(){return e?l?l(y):y():E(),E},[e]),(0,d.Z)(function(){m.length&&(m.forEach(function(e){return e()}),b(p))},[m]),[r,h]}(_&&!P,0),F=(0,a.Z)(M,2),U=F[0],B=F[1],G=null!=P?P:U;n=!!(T&&S&&(0,s.Z)()&&(G===U||G===document.body)),r=o.useState(function(){return b+=1,"".concat(m,"_").concat(b)}),E=(0,a.Z)(r,1)[0],(0,d.Z)(function(){if(n){var e=function(e){if("undefined"==typeof document||!e||!(e instanceof Element))return{width:0,height:0};var t=getComputedStyle(e,"::-webkit-scrollbar"),n=t.width,r=t.height;return{width:g(n),height:g(r)}}(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}"),E)}else(0,f.jL)(E);return function(){(0,f.jL)(E)}},[n,E]);var Z=null;R&&(0,l.Yr)(R)&&t&&(Z=R.ref);var j=(0,l.x1)(Z,t);if(!_||!(0,s.Z)()||void 0===P)return null;var $=!1===G||("boolean"==typeof v&&(h=v),h),z=R;return t&&(z=o.cloneElement(R,{ref:j})),o.createElement(c.Provider,{value:B},$?z:(0,i.createPortal)(z,G))})},44101:function(e,t,n){n.d(t,{Z:function(){return j}});var r=n(5239),a=n(80406),o=n(60635),i=n(88804),s=n(16480),l=n.n(s),c=n(46505),u=n(97472),d=n(74687),p=n(54811),f=n(91010),g=n(24800),m=n(76158),b=n(64090),h=n(14749),y=n(49367),E=n(74084);function v(e){var t=e.prefixCls,n=e.align,r=e.arrow,a=e.arrowPos,o=r||{},i=o.className,s=o.content,c=a.x,u=a.y,d=b.useRef();if(!n||!n.points)return null;var p={position:"absolute"};if(!1!==n.autoArrow){var f=n.points[0],g=n.points[1],m=f[0],h=f[1],y=g[0],E=g[1];m!==y&&["t","b"].includes(m)?"t"===m?p.top=0:p.bottom=0:p.top=void 0===u?0:u,h!==E&&["l","r"].includes(h)?"l"===h?p.left=0:p.right=0:p.left=void 0===c?0:c}return b.createElement("div",{ref:d,className:l()("".concat(t,"-arrow"),i),style:p},s)}function S(e){var t=e.prefixCls,n=e.open,r=e.zIndex,a=e.mask,o=e.motion;return a?b.createElement(y.ZP,(0,h.Z)({},o,{motionAppear:!0,visible:n,removeOnLeave:!0}),function(e){var n=e.className;return b.createElement("div",{style:{zIndex:r},className:l()("".concat(t,"-mask"),n)})}):null}var T=b.memo(function(e){return e.children},function(e,t){return t.cache}),w=b.forwardRef(function(e,t){var n=e.popup,o=e.className,i=e.prefixCls,s=e.style,u=e.target,d=e.onVisibleChanged,p=e.open,f=e.keepDom,m=e.fresh,w=e.onClick,A=e.mask,k=e.arrow,R=e.arrowPos,x=e.align,C=e.motion,N=e.maskMotion,I=e.forceRender,_=e.getPopupContainer,O=e.autoDestroy,L=e.portal,P=e.zIndex,D=e.onMouseEnter,M=e.onMouseLeave,F=e.onPointerEnter,U=e.ready,B=e.offsetX,G=e.offsetY,Z=e.offsetR,j=e.offsetB,$=e.onAlign,z=e.onPrepare,H=e.stretch,V=e.targetWidth,W=e.targetHeight,q="function"==typeof n?n():n,Y=p||f,K=(null==_?void 0:_.length)>0,X=b.useState(!_||!K),Q=(0,a.Z)(X,2),J=Q[0],ee=Q[1];if((0,g.Z)(function(){!J&&K&&u&&ee(!0)},[J,K,u]),!J)return null;var et="auto",en={left:"-1000vw",top:"-1000vh",right:et,bottom:et};if(U||!p){var er,ea=x.points,eo=x.dynamicInset||(null===(er=x._experimental)||void 0===er?void 0:er.dynamicInset),ei=eo&&"r"===ea[0][1],es=eo&&"b"===ea[0][0];ei?(en.right=Z,en.left=et):(en.left=B,en.right=et),es?(en.bottom=j,en.top=et):(en.top=G,en.bottom=et)}var el={};return H&&(H.includes("height")&&W?el.height=W:H.includes("minHeight")&&W&&(el.minHeight=W),H.includes("width")&&V?el.width=V:H.includes("minWidth")&&V&&(el.minWidth=V)),p||(el.pointerEvents="none"),b.createElement(L,{open:I||Y,getContainer:_&&function(){return _(u)},autoDestroy:O},b.createElement(S,{prefixCls:i,open:p,zIndex:P,mask:A,motion:N}),b.createElement(c.Z,{onResize:$,disabled:!p},function(e){return b.createElement(y.ZP,(0,h.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:I,leavedClassName:"".concat(i,"-hidden")},C,{onAppearPrepare:z,onEnterPrepare:z,visible:p,onVisibleChanged:function(e){var t;null==C||null===(t=C.onVisibleChanged)||void 0===t||t.call(C,e),d(e)}}),function(n,a){var c=n.className,u=n.style,d=l()(i,c,o);return b.createElement("div",{ref:(0,E.sQ)(e,t,a),className:d,style:(0,r.Z)((0,r.Z)((0,r.Z)((0,r.Z)({"--arrow-x":"".concat(R.x||0,"px"),"--arrow-y":"".concat(R.y||0,"px")},en),el),u),{},{boxSizing:"border-box",zIndex:P},s),onMouseEnter:D,onMouseLeave:M,onPointerEnter:F,onClick:w},k&&b.createElement(v,{prefixCls:i,arrow:k,arrowPos:R,align:x}),b.createElement(T,{cache:!p&&!m},q))})}))}),A=b.forwardRef(function(e,t){var n=e.children,r=e.getTriggerDOMNode,a=(0,E.Yr)(n),o=b.useCallback(function(e){(0,E.mH)(t,r?r(e):e)},[r]),i=(0,E.x1)(o,n.ref);return a?b.cloneElement(n,{ref:i}):n}),k=b.createContext(null);function R(e){return e?Array.isArray(e)?e:[e]:[]}var x=n(73193);function C(e,t,n,r){return t||(n?{motionName:"".concat(e,"-").concat(n)}:r?{motionName:r}:null)}function N(e){return e.ownerDocument.defaultView}function I(e){for(var t=[],n=null==e?void 0:e.parentElement,r=["hidden","scroll","clip","auto"];n;){var a=N(n).getComputedStyle(n);[a.overflowX,a.overflowY,a.overflow].some(function(e){return r.includes(e)})&&t.push(n),n=n.parentElement}return t}function _(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isNaN(e)?t:e}function O(e){return _(parseFloat(e),0)}function L(e,t){var n=(0,r.Z)({},e);return(t||[]).forEach(function(e){if(!(e instanceof HTMLBodyElement||e instanceof HTMLHtmlElement)){var t=N(e).getComputedStyle(e),r=t.overflow,a=t.overflowClipMargin,o=t.borderTopWidth,i=t.borderBottomWidth,s=t.borderLeftWidth,l=t.borderRightWidth,c=e.getBoundingClientRect(),u=e.offsetHeight,d=e.clientHeight,p=e.offsetWidth,f=e.clientWidth,g=O(o),m=O(i),b=O(s),h=O(l),y=_(Math.round(c.width/p*1e3)/1e3),E=_(Math.round(c.height/u*1e3)/1e3),v=g*E,S=b*y,T=0,w=0;if("clip"===r){var A=O(a);T=A*y,w=A*E}var k=c.x+S-T,R=c.y+v-w,x=k+c.width+2*T-S-h*y-(p-f-b-h)*y,C=R+c.height+2*w-v-m*E-(u-d-g-m)*E;n.left=Math.max(n.left,k),n.top=Math.max(n.top,R),n.right=Math.min(n.right,x),n.bottom=Math.min(n.bottom,C)}}),n}function P(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 D(e,t){var n=(0,a.Z)(t||[],2),r=n[0],o=n[1];return[P(e.width,r),P(e.height,o)]}function M(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return[e[0],e[1]]}function F(e,t){var n,r=t[0],a=t[1];return n="t"===r?e.y:"b"===r?e.y+e.height:e.y+e.height/2,{x:"l"===a?e.x:"r"===a?e.x+e.width:e.x+e.width/2,y:n}}function U(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 B=n(63787);n(53850);var G=n(19223),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"],j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.Z;return b.forwardRef(function(t,n){var i,s,h,y,E,v,S,T,O,P,j,$,z,H,V,W,q,Y=t.prefixCls,K=void 0===Y?"rc-trigger-popup":Y,X=t.children,Q=t.action,J=t.showAction,ee=t.hideAction,et=t.popupVisible,en=t.defaultPopupVisible,er=t.onPopupVisibleChange,ea=t.afterPopupVisibleChange,eo=t.mouseEnterDelay,ei=t.mouseLeaveDelay,es=void 0===ei?.1:ei,el=t.focusDelay,ec=t.blurDelay,eu=t.mask,ed=t.maskClosable,ep=t.getPopupContainer,ef=t.forceRender,eg=t.autoDestroy,em=t.destroyPopupOnHide,eb=t.popup,eh=t.popupClassName,ey=t.popupStyle,eE=t.popupPlacement,ev=t.builtinPlacements,eS=void 0===ev?{}:ev,eT=t.popupAlign,ew=t.zIndex,eA=t.stretch,ek=t.getPopupClassNameFromAlign,eR=t.fresh,ex=t.alignPoint,eC=t.onPopupClick,eN=t.onPopupAlign,eI=t.arrow,e_=t.popupMotion,eO=t.maskMotion,eL=t.popupTransitionName,eP=t.popupAnimation,eD=t.maskTransitionName,eM=t.maskAnimation,eF=t.className,eU=t.getTriggerDOMNode,eB=(0,o.Z)(t,Z),eG=b.useState(!1),eZ=(0,a.Z)(eG,2),ej=eZ[0],e$=eZ[1];(0,g.Z)(function(){e$((0,m.Z)())},[]);var ez=b.useRef({}),eH=b.useContext(k),eV=b.useMemo(function(){return{registerSubPopup:function(e,t){ez.current[e]=t,null==eH||eH.registerSubPopup(e,t)}}},[eH]),eW=(0,f.Z)(),eq=b.useState(null),eY=(0,a.Z)(eq,2),eK=eY[0],eX=eY[1],eQ=(0,p.Z)(function(e){(0,u.S)(e)&&eK!==e&&eX(e),null==eH||eH.registerSubPopup(eW,e)}),eJ=b.useState(null),e0=(0,a.Z)(eJ,2),e1=e0[0],e2=e0[1],e4=b.useRef(null),e3=(0,p.Z)(function(e){(0,u.S)(e)&&e1!==e&&(e2(e),e4.current=e)}),e6=b.Children.only(X),e5=(null==e6?void 0:e6.props)||{},e9={},e8=(0,p.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==eK?void 0:eK.contains(e))||(null===(n=(0,d.A)(eK))||void 0===n?void 0:n.host)===e||e===eK||Object.values(ez.current).some(function(t){return(null==t?void 0:t.contains(e))||e===t})}),e7=C(K,e_,eP,eL),te=C(K,eO,eM,eD),tt=b.useState(en||!1),tn=(0,a.Z)(tt,2),tr=tn[0],ta=tn[1],to=null!=et?et:tr,ti=(0,p.Z)(function(e){void 0===et&&ta(e)});(0,g.Z)(function(){ta(et||!1)},[et]);var ts=b.useRef(to);ts.current=to;var tl=b.useRef([]);tl.current=[];var tc=(0,p.Z)(function(e){var t;ti(e),(null!==(t=tl.current[tl.current.length-1])&&void 0!==t?t:to)!==e&&(tl.current.push(e),null==er||er(e))}),tu=b.useRef(),td=function(){clearTimeout(tu.current)},tp=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;td(),0===t?tc(e):tu.current=setTimeout(function(){tc(e)},1e3*t)};b.useEffect(function(){return td},[]);var tf=b.useState(!1),tg=(0,a.Z)(tf,2),tm=tg[0],tb=tg[1];(0,g.Z)(function(e){(!e||to)&&tb(!0)},[to]);var th=b.useState(null),ty=(0,a.Z)(th,2),tE=ty[0],tv=ty[1],tS=b.useState([0,0]),tT=(0,a.Z)(tS,2),tw=tT[0],tA=tT[1],tk=function(e){tA([e.clientX,e.clientY])},tR=(i=ex?tw:e1,s=b.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:eS[eE]||{}}),y=(h=(0,a.Z)(s,2))[0],E=h[1],v=b.useRef(0),S=b.useMemo(function(){return eK?I(eK):[]},[eK]),T=b.useRef({}),to||(T.current={}),O=(0,p.Z)(function(){if(eK&&i&&to){var e,t,n,o,s,l,c,d=eK.ownerDocument,p=N(eK).getComputedStyle(eK),f=p.width,g=p.height,m=p.position,b=eK.style.left,h=eK.style.top,y=eK.style.right,v=eK.style.bottom,w=eK.style.overflow,A=(0,r.Z)((0,r.Z)({},eS[eE]),eT),k=d.createElement("div");if(null===(e=eK.parentElement)||void 0===e||e.appendChild(k),k.style.left="".concat(eK.offsetLeft,"px"),k.style.top="".concat(eK.offsetTop,"px"),k.style.position=m,k.style.height="".concat(eK.offsetHeight,"px"),k.style.width="".concat(eK.offsetWidth,"px"),eK.style.left="0",eK.style.top="0",eK.style.right="auto",eK.style.bottom="auto",eK.style.overflow="hidden",Array.isArray(i))n={x:i[0],y:i[1],width:0,height:0};else{var R=i.getBoundingClientRect();n={x:R.x,y:R.y,width:R.width,height:R.height}}var C=eK.getBoundingClientRect(),I=d.documentElement,O=I.clientWidth,P=I.clientHeight,B=I.scrollWidth,G=I.scrollHeight,Z=I.scrollTop,j=I.scrollLeft,$=C.height,z=C.width,H=n.height,V=n.width,W=A.htmlRegion,q="visible",Y="visibleFirst";"scroll"!==W&&W!==Y&&(W=q);var K=W===Y,X=L({left:-j,top:-Z,right:B-j,bottom:G-Z},S),Q=L({left:0,top:0,right:O,bottom:P},S),J=W===q?Q:X,ee=K?Q:J;eK.style.left="auto",eK.style.top="auto",eK.style.right="0",eK.style.bottom="0";var et=eK.getBoundingClientRect();eK.style.left=b,eK.style.top=h,eK.style.right=y,eK.style.bottom=v,eK.style.overflow=w,null===(t=eK.parentElement)||void 0===t||t.removeChild(k);var en=_(Math.round(z/parseFloat(f)*1e3)/1e3),er=_(Math.round($/parseFloat(g)*1e3)/1e3);if(!(0===en||0===er||(0,u.S)(i)&&!(0,x.Z)(i))){var ea=A.offset,eo=A.targetOffset,ei=D(C,ea),es=(0,a.Z)(ei,2),el=es[0],ec=es[1],eu=D(n,eo),ed=(0,a.Z)(eu,2),ep=ed[0],ef=ed[1];n.x-=ep,n.y-=ef;var eg=A.points||[],em=(0,a.Z)(eg,2),eb=em[0],eh=M(em[1]),ey=M(eb),ev=F(n,eh),ew=F(C,ey),eA=(0,r.Z)({},A),ek=ev.x-ew.x+el,eR=ev.y-ew.y+ec,ex=tt(ek,eR),eC=tt(ek,eR,Q),eI=F(n,["t","l"]),e_=F(C,["t","l"]),eO=F(n,["b","r"]),eL=F(C,["b","r"]),eP=A.overflow||{},eD=eP.adjustX,eM=eP.adjustY,eF=eP.shiftX,eU=eP.shiftY,eB=function(e){return"boolean"==typeof e?e:e>=0};tn();var eG=eB(eM),eZ=ey[0]===eh[0];if(eG&&"t"===ey[0]&&(s>ee.bottom||T.current.bt)){var ej=eR;eZ?ej-=$-H:ej=eI.y-eL.y-ec;var e$=tt(ek,ej),ez=tt(ek,ej,Q);e$>ex||e$===ex&&(!K||ez>=eC)?(T.current.bt=!0,eR=ej,ec=-ec,eA.points=[U(ey,0),U(eh,0)]):T.current.bt=!1}if(eG&&"b"===ey[0]&&(oex||eV===ex&&(!K||eW>=eC)?(T.current.tb=!0,eR=eH,ec=-ec,eA.points=[U(ey,0),U(eh,0)]):T.current.tb=!1}var eq=eB(eD),eY=ey[1]===eh[1];if(eq&&"l"===ey[1]&&(c>ee.right||T.current.rl)){var eX=ek;eY?eX-=z-V:eX=eI.x-eL.x-el;var eQ=tt(eX,eR),eJ=tt(eX,eR,Q);eQ>ex||eQ===ex&&(!K||eJ>=eC)?(T.current.rl=!0,ek=eX,el=-el,eA.points=[U(ey,1),U(eh,1)]):T.current.rl=!1}if(eq&&"r"===ey[1]&&(lex||e1===ex&&(!K||e2>=eC)?(T.current.lr=!0,ek=e0,el=-el,eA.points=[U(ey,1),U(eh,1)]):T.current.lr=!1}tn();var e4=!0===eF?0:eF;"number"==typeof e4&&(lQ.right&&(ek-=c-Q.right-el,n.x>Q.right-e4&&(ek+=n.x-Q.right+e4)));var e3=!0===eU?0:eU;"number"==typeof e3&&(oQ.bottom&&(eR-=s-Q.bottom-ec,n.y>Q.bottom-e3&&(eR+=n.y-Q.bottom+e3)));var e6=C.x+ek,e5=C.y+eR,e9=n.x,e8=n.y;null==eN||eN(eK,eA);var e7=et.right-C.x-(ek+C.width),te=et.bottom-C.y-(eR+C.height);E({ready:!0,offsetX:ek/en,offsetY:eR/er,offsetR:e7/en,offsetB:te/er,arrowX:((Math.max(e6,e9)+Math.min(e6+z,e9+V))/2-e6)/en,arrowY:((Math.max(e5,e8)+Math.min(e5+$,e8+H))/2-e5)/er,scaleX:en,scaleY:er,align:eA})}function tt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:J,r=C.x+e,a=C.y+t,o=Math.max(r,n.left),i=Math.max(a,n.top);return Math.max(0,(Math.min(r+z,n.right)-o)*(Math.min(a+$,n.bottom)-i))}function tn(){s=(o=C.y+eR)+$,c=(l=C.x+ek)+z}}}),P=function(){E(function(e){return(0,r.Z)((0,r.Z)({},e),{},{ready:!1})})},(0,g.Z)(P,[eE]),(0,g.Z)(function(){to||P()},[to]),[y.ready,y.offsetX,y.offsetY,y.offsetR,y.offsetB,y.arrowX,y.arrowY,y.scaleX,y.scaleY,y.align,function(){v.current+=1;var e=v.current;Promise.resolve().then(function(){v.current===e&&O()})}]),tx=(0,a.Z)(tR,11),tC=tx[0],tN=tx[1],tI=tx[2],t_=tx[3],tO=tx[4],tL=tx[5],tP=tx[6],tD=tx[7],tM=tx[8],tF=tx[9],tU=tx[10],tB=(j=void 0===Q?"hover":Q,b.useMemo(function(){var e=R(null!=J?J:j),t=R(null!=ee?ee:j),n=new Set(e),r=new Set(t);return ej&&(n.has("hover")&&(n.delete("hover"),n.add("click")),r.has("hover")&&(r.delete("hover"),r.add("click"))),[n,r]},[ej,j,J,ee])),tG=(0,a.Z)(tB,2),tZ=tG[0],tj=tG[1],t$=tZ.has("click"),tz=tj.has("click")||tj.has("contextMenu"),tH=(0,p.Z)(function(){tm||tU()});$=function(){ts.current&&ex&&tz&&tp(!1)},(0,g.Z)(function(){if(to&&e1&&eK){var e=I(e1),t=I(eK),n=N(eK),r=new Set([n].concat((0,B.Z)(e),(0,B.Z)(t)));function a(){tH(),$()}return r.forEach(function(e){e.addEventListener("scroll",a,{passive:!0})}),n.addEventListener("resize",a,{passive:!0}),tH(),function(){r.forEach(function(e){e.removeEventListener("scroll",a),n.removeEventListener("resize",a)})}}},[to,e1,eK]),(0,g.Z)(function(){tH()},[tw,eE]),(0,g.Z)(function(){to&&!(null!=eS&&eS[eE])&&tH()},[JSON.stringify(eT)]);var tV=b.useMemo(function(){var e=function(e,t,n,r){for(var a=n.points,o=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===(s=e[l])||void 0===s?void 0:s.points,a,r))return"".concat(t,"-placement-").concat(l)}return""}(eS,K,tF,ex);return l()(e,null==ek?void 0:ek(tF))},[tF,ek,eS,K,ex]);b.useImperativeHandle(n,function(){return{nativeElement:e4.current,forceAlign:tH}});var tW=b.useState(0),tq=(0,a.Z)(tW,2),tY=tq[0],tK=tq[1],tX=b.useState(0),tQ=(0,a.Z)(tX,2),tJ=tQ[0],t0=tQ[1],t1=function(){if(eA&&e1){var e=e1.getBoundingClientRect();tK(e.width),t0(e.height)}};function t2(e,t,n,r){e9[e]=function(a){var o;null==r||r(a),tp(t,n);for(var i=arguments.length,s=Array(i>1?i-1:0),l=1;l1?n-1:0),a=1;a1?n-1:0),a=1;a{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),o.createElement("path",{d:"M18.364 5.636L16.95 7.05A7 7 0 1 0 19 12h2a9 9 0 1 1-2.636-6.364z"}))};var T=n(2898);let w={xs:{height:"h-4",width:"w-4"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-6",width:"w-6"},xl:{height:"h-6",width:"w-6"}},A=e=>"light"!==e?{xs:{paddingX:"px-2.5",paddingY:"py-1.5",fontSize:"text-xs"},sm:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-sm"},md:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-md"},lg:{paddingX:"px-4",paddingY:"py-2.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-3",fontSize:"text-xl"}}:{xs:{paddingX:"",paddingY:"",fontSize:"text-xs"},sm:{paddingX:"",paddingY:"",fontSize:"text-sm"},md:{paddingX:"",paddingY:"",fontSize:"text-md"},lg:{paddingX:"",paddingY:"",fontSize:"text-lg"},xl:{paddingX:"",paddingY:"",fontSize:"text-xl"}},k=(e,t)=>{switch(e){case"primary":return{textColor:t?(0,v.bM)("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",hoverTextColor:t?(0,v.bM)("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,v.bM)(t,T.K.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",hoverBgColor:t?(0,v.bM)(t,T.K.darkBackground).hoverBgColor:"hover:bg-tremor-brand-emphasis dark:hover:bg-dark-tremor-brand-emphasis",borderColor:t?(0,v.bM)(t,T.K.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",hoverBorderColor:t?(0,v.bM)(t,T.K.darkBorder).hoverBorderColor:"hover:border-tremor-brand-emphasis dark:hover:border-dark-tremor-brand-emphasis"};case"secondary":return{textColor:t?(0,v.bM)(t,T.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:t?(0,v.bM)(t,T.K.text).textColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:(0,v.bM)("transparent").bgColor,hoverBgColor:t?(0,E.q)((0,v.bM)(t,T.K.background).hoverBgColor,"hover:bg-opacity-20 dark:hover:bg-opacity-20"):"hover:bg-tremor-brand-faint dark:hover:bg-dark-tremor-brand-faint",borderColor:t?(0,v.bM)(t,T.K.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand"};case"light":return{textColor:t?(0,v.bM)(t,T.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:t?(0,v.bM)(t,T.K.darkText).hoverTextColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:(0,v.bM)("transparent").bgColor,borderColor:"",hoverBorderColor:""}}},R=(0,v.fn)("Button"),x=e=>{let{loading:t,iconSize:n,iconPosition:r,Icon:a,needMargin:i,transitionState:s}=e,l=i?r===y.zS.Left?(0,E.q)("-ml-1","mr-1.5"):(0,E.q)("-mr-1","ml-1.5"):"",c=(0,E.q)("w-0 h-0"),u={default:c,entering:c,entered:n,exiting:n,exited:c};return t?o.createElement(S,{className:(0,E.q)(R("icon"),"animate-spin shrink-0",l,u.default,u[s]),style:{transition:"width 150ms"}}):o.createElement(a,{className:(0,E.q)(R("icon"),"shrink-0",n,l)})},C=o.forwardRef((e,t)=>{let{icon:n,iconPosition:i=y.zS.Left,size:s=y.u8.SM,color:l,variant:c="primary",disabled:u,loading:d=!1,loadingText:p,children:f,tooltip:g,className:m}=e,h=(0,r._T)(e,["icon","iconPosition","size","color","variant","disabled","loading","loadingText","children","tooltip","className"]),S=d||u,T=void 0!==n||d,C=d&&p,N=!(!f&&!C),I=(0,E.q)(w[s].height,w[s].width),_="light"!==c?(0,E.q)("rounded-tremor-default border","shadow-tremor-input","dark:shadow-dark-tremor-input"):"",O=k(c,l),L=A(c)[s],{tooltipProps:P,getReferenceProps:D}=(0,a.l)(300);return o.createElement(b,{in:d,timeout:50},e=>o.createElement("button",Object.assign({ref:(0,v.lq)([t,P.refs.setReference]),className:(0,E.q)(R("root"),"flex-shrink-0 inline-flex justify-center items-center group font-medium outline-none",_,L.paddingX,L.paddingY,L.fontSize,O.textColor,O.bgColor,O.borderColor,O.hoverBorderColor,S?"opacity-50 cursor-not-allowed":(0,E.q)(k(c,l).hoverTextColor,k(c,l).hoverBgColor,k(c,l).hoverBorderColor),m),disabled:S},D,h),o.createElement(a.Z,Object.assign({text:g},P)),T&&i!==y.zS.Right?o.createElement(x,{loading:d,iconSize:I,iconPosition:i,Icon:n,transitionState:e,needMargin:N}):null,C||f?o.createElement("span",{className:(0,E.q)(R("text"),"text-sm whitespace-nowrap")},C?p:f):null,T&&i===y.zS.Right?o.createElement(x,{loading:d,iconSize:I,iconPosition:i,Icon:n,transitionState:e,needMargin:N}):null))});C.displayName="Button"},92836:function(e,t,n){n.d(t,{Z:function(){return p}});var r=n(69703),a=n(80991),o=n(2898),i=n(99250),s=n(65492),l=n(64090),c=n(41608),u=n(50027);n(18174),n(21871),n(41213);let d=(0,s.fn)("Tab"),p=l.forwardRef((e,t)=>{let{icon:n,className:p,children:f}=e,g=(0,r._T)(e,["icon","className","children"]),m=(0,l.useContext)(c.O),b=(0,l.useContext)(u.Z);return l.createElement(a.O,Object.assign({ref:t,className:(0,i.q)(d("root"),"flex whitespace-nowrap truncate max-w-xs outline-none focus:ring-0 text-tremor-default transition duration-100",b?(0,s.bM)(b,o.K.text).selectTextColor:"solid"===m?"ui-selected:text-tremor-content-emphasis dark:ui-selected:text-dark-tremor-content-emphasis":"ui-selected:text-tremor-brand dark:ui-selected:text-dark-tremor-brand",function(e,t){switch(e){case"line":return(0,i.q)("ui-selected:border-b-2 hover:border-b-2 border-transparent transition duration-100 -mb-px px-2 py-2","hover:border-tremor-content hover:text-tremor-content-emphasis text-tremor-content","dark:hover:border-dark-tremor-content-emphasis dark:hover:text-dark-tremor-content-emphasis dark:text-dark-tremor-content",t?(0,s.bM)(t,o.K.border).selectBorderColor:"ui-selected:border-tremor-brand dark:ui-selected:border-dark-tremor-brand");case"solid":return(0,i.q)("border-transparent border rounded-tremor-small px-2.5 py-1","ui-selected:border-tremor-border ui-selected:bg-tremor-background ui-selected:shadow-tremor-input hover:text-tremor-content-emphasis ui-selected:text-tremor-brand","dark:ui-selected:border-dark-tremor-border dark:ui-selected:bg-dark-tremor-background dark:ui-selected:shadow-dark-tremor-input dark:hover:text-dark-tremor-content-emphasis dark:ui-selected:text-dark-tremor-brand",t?(0,s.bM)(t,o.K.text).selectTextColor:"text-tremor-content dark:text-dark-tremor-content")}}(m,b),p)},g),n?l.createElement(n,{className:(0,i.q)(d("icon"),"flex-none h-5 w-5",f?"mr-2":"")}):null,f?l.createElement("span",null,f):null)});p.displayName="Tab"},26734:function(e,t,n){n.d(t,{Z:function(){return c}});var r=n(69703),a=n(80991),o=n(99250),i=n(65492),s=n(64090);let l=(0,i.fn)("TabGroup"),c=s.forwardRef((e,t)=>{let{defaultIndex:n,index:i,onIndexChange:c,children:u,className:d}=e,p=(0,r._T)(e,["defaultIndex","index","onIndexChange","children","className"]);return s.createElement(a.O.Group,Object.assign({as:"div",ref:t,defaultIndex:n,selectedIndex:i,onChange:c,className:(0,o.q)(l("root"),"w-full",d)},p),u)});c.displayName="TabGroup"},41608:function(e,t,n){n.d(t,{O:function(){return c},Z:function(){return d}});var r=n(69703),a=n(64090),o=n(50027);n(18174),n(21871),n(41213);var i=n(80991),s=n(99250);let l=(0,n(65492).fn)("TabList"),c=(0,a.createContext)("line"),u={line:(0,s.q)("flex border-b space-x-4","border-tremor-border","dark:border-dark-tremor-border"),solid:(0,s.q)("inline-flex p-0.5 rounded-tremor-default space-x-1.5","bg-tremor-background-subtle","dark:bg-dark-tremor-background-subtle")},d=a.forwardRef((e,t)=>{let{color:n,variant:d="line",children:p,className:f}=e,g=(0,r._T)(e,["color","variant","children","className"]);return a.createElement(i.O.List,Object.assign({ref:t,className:(0,s.q)(l("root"),"justify-start overflow-x-clip",u[d],f)},g),a.createElement(c.Provider,{value:d},a.createElement(o.Z.Provider,{value:n},p)))});d.displayName="TabList"},32126:function(e,t,n){n.d(t,{Z:function(){return u}});var r=n(69703);n(50027);var a=n(18174);n(21871);var o=n(41213),i=n(99250),s=n(65492),l=n(64090);let c=(0,s.fn)("TabPanel"),u=l.forwardRef((e,t)=>{let{children:n,className:s}=e,u=(0,r._T)(e,["children","className"]),{selectedValue:d}=(0,l.useContext)(o.Z),p=d===(0,l.useContext)(a.Z);return l.createElement("div",Object.assign({ref:t,className:(0,i.q)(c("root"),"w-full mt-2",p?"":"hidden",s),"aria-selected":p?"true":"false"},u),n)});u.displayName="TabPanel"},23682:function(e,t,n){n.d(t,{Z:function(){return d}});var r=n(69703),a=n(80991);n(50027);var o=n(18174);n(21871);var i=n(41213),s=n(99250),l=n(65492),c=n(64090);let u=(0,l.fn)("TabPanels"),d=c.forwardRef((e,t)=>{let{children:n,className:l}=e,d=(0,r._T)(e,["children","className"]);return c.createElement(a.O.Panels,Object.assign({as:"div",ref:t,className:(0,s.q)(u("root"),"w-full",l)},d),e=>{let{selectedIndex:t}=e;return c.createElement(i.Z.Provider,{value:{selectedValue:t}},c.Children.map(n,(e,t)=>c.createElement(o.Z.Provider,{value:t},e)))})});d.displayName="TabPanels"},13810:function(e,t,n){n.d(t,{Z:function(){return d}});var r=n(69703),a=n(64090),o=n(54942),i=n(2898),s=n(99250),l=n(65492);let c=(0,l.fn)("Card"),u=e=>{if(!e)return"";switch(e){case o.zS.Left:return"border-l-4";case o.m.Top:return"border-t-4";case o.zS.Right:return"border-r-4";case o.m.Bottom:return"border-b-4";default:return""}},d=a.forwardRef((e,t)=>{let{decoration:n="",decorationColor:o,children:d,className:p}=e,f=(0,r._T)(e,["decoration","decorationColor","children","className"]);return a.createElement("div",Object.assign({ref:t,className:(0,s.q)(c("root"),"relative w-full text-left ring-1 rounded-tremor-default p-6","bg-tremor-background ring-tremor-ring shadow-tremor-card","dark:bg-dark-tremor-background dark:ring-dark-tremor-ring dark:shadow-dark-tremor-card",o?(0,l.bM)(o,i.K.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",u(n),p)},f),d)});d.displayName="Card"},71801:function(e,t,n){n.d(t,{Z:function(){return s}});var r=n(2898),a=n(99250),o=n(65492),i=n(64090);let s=i.forwardRef((e,t)=>{let{color:n,className:s,children:l}=e;return i.createElement("p",{ref:t,className:(0,a.q)("text-tremor-default",n?(0,o.bM)(n,r.K.text).textColor:(0,a.q)("text-tremor-content","dark:text-dark-tremor-content"),s)},l)});s.displayName="Text"},42440:function(e,t,n){n.d(t,{Z:function(){return l}});var r=n(69703),a=n(2898),o=n(99250),i=n(65492),s=n(64090);let l=s.forwardRef((e,t)=>{let{color:n,children:l,className:c}=e,u=(0,r._T)(e,["color","children","className"]);return s.createElement("p",Object.assign({ref:t,className:(0,o.q)("font-medium text-tremor-title",n?(0,i.bM)(n,a.K.darkText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",c)},u),l)});l.displayName="Title"},58437:function(e,t,n){n.d(t,{Z:function(){return eG},l:function(){return eB}});var r=n(64090),a=n.t(r,2),o=n(89542);function i(e){return c(e)?(e.nodeName||"").toLowerCase():"#document"}function s(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function l(e){var t;return null==(t=(c(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function c(e){return e instanceof Node||e instanceof s(e).Node}function u(e){return e instanceof Element||e instanceof s(e).Element}function d(e){return e instanceof HTMLElement||e instanceof s(e).HTMLElement}function p(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof s(e).ShadowRoot)}function f(e){let{overflow:t,overflowX:n,overflowY:r,display:a}=y(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function g(e){let t=b(),n=y(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some(e=>(n.willChange||"").includes(e))||["paint","layout","strict","content"].some(e=>(n.contain||"").includes(e))}function m(e){let t=v(e);for(;d(t)&&!h(t);){if(g(t))return t;t=v(t)}return null}function b(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}function h(e){return["html","body","#document"].includes(i(e))}function y(e){return s(e).getComputedStyle(e)}function E(e){return u(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function v(e){if("html"===i(e))return e;let t=e.assignedSlot||e.parentNode||p(e)&&e.host||l(e);return p(t)?t.host:t}function S(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let a=function e(t){let n=v(t);return h(n)?t.ownerDocument?t.ownerDocument.body:t.body:d(n)&&f(n)?n:e(n)}(e),o=a===(null==(r=e.ownerDocument)?void 0:r.body),i=s(a);return o?t.concat(i,i.visualViewport||[],f(a)?a:[],i.frameElement&&n?S(i.frameElement):[]):t.concat(a,S(a,[],n))}let T=Math.min,w=Math.max,A=Math.round,k=Math.floor,R=e=>({x:e,y:e}),x={left:"right",right:"left",bottom:"top",top:"bottom"},C={start:"end",end:"start"};function N(e,t){return"function"==typeof e?e(t):e}function I(e){return e.split("-")[0]}function _(e){return e.split("-")[1]}function O(e){return"x"===e?"y":"x"}function L(e){return"y"===e?"height":"width"}function P(e){return["top","bottom"].includes(I(e))?"y":"x"}function D(e){return e.replace(/start|end/g,e=>C[e])}function M(e){return e.replace(/left|right|bottom|top/g,e=>x[e])}function F(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function U(e,t,n){let r,{reference:a,floating:o}=e,i=P(t),s=O(P(t)),l=L(s),c=I(t),u="y"===i,d=a.x+a.width/2-o.width/2,p=a.y+a.height/2-o.height/2,f=a[l]/2-o[l]/2;switch(c){case"top":r={x:d,y:a.y-o.height};break;case"bottom":r={x:d,y:a.y+a.height};break;case"right":r={x:a.x+a.width,y:p};break;case"left":r={x:a.x-o.width,y:p};break;default:r={x:a.x,y:a.y}}switch(_(t)){case"start":r[s]-=f*(n&&u?-1:1);break;case"end":r[s]+=f*(n&&u?-1:1)}return r}let B=async(e,t,n)=>{let{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:i}=n,s=o.filter(Boolean),l=await (null==i.isRTL?void 0:i.isRTL(t)),c=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=U(c,r,l),p=r,f={},g=0;for(let n=0;n{!function(n){try{t=t||e.matches(n)}catch(e){}}(n)});let a=m(e);if(t&&a){let e=a.getBoundingClientRect();n=e.x,r=e.y}return[t,n,r]}function K(e){return W(l(e)).left+E(e).scrollLeft}function X(e,t,n){let r;if("viewport"===t)r=function(e,t){let n=s(e),r=l(e),a=n.visualViewport,o=r.clientWidth,i=r.clientHeight,c=0,u=0;if(a){o=a.width,i=a.height;let e=b();(!e||e&&"fixed"===t)&&(c=a.offsetLeft,u=a.offsetTop)}return{width:o,height:i,x:c,y:u}}(e,n);else if("document"===t)r=function(e){let t=l(e),n=E(e),r=e.ownerDocument.body,a=w(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=w(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),i=-n.scrollLeft+K(e),s=-n.scrollTop;return"rtl"===y(r).direction&&(i+=w(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:i,y:s}}(l(e));else if(u(t))r=function(e,t){let n=W(e,!0,"fixed"===t),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=d(e)?z(e):R(1),i=e.clientWidth*o.x;return{width:i,height:e.clientHeight*o.y,x:a*o.x,y:r*o.y}}(t,n);else{let n=V(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return F(r)}function Q(e,t){return d(e)&&"fixed"!==y(e).position?t?t(e):e.offsetParent:null}function J(e,t){let n=s(e);if(!d(e))return n;let r=Q(e,t);for(;r&&["table","td","th"].includes(i(r))&&"static"===y(r).position;)r=Q(r,t);return r&&("html"===i(r)||"body"===i(r)&&"static"===y(r).position&&!g(r))?n:r||m(e)||n}let ee=async function(e){let t=this.getOffsetParent||J,n=this.getDimensions;return{reference:function(e,t,n,r){let a=d(t),o=l(t),s="fixed"===n,c=W(e,!0,s,t),u={scrollLeft:0,scrollTop:0},p=R(0);if(a||!a&&!s){if(("body"!==i(t)||f(o))&&(u=E(t)),a){let e=W(t,!0,s,t);p.x=e.x+t.clientLeft,p.y=e.y+t.clientTop}else o&&(p.x=K(o))}let g=c.left+u.scrollLeft-p.x,m=c.top+u.scrollTop-p.y,[b,h,y]=Y(r);return b&&(g+=h,m+=y,a&&(g+=t.clientLeft,m+=t.clientTop)),{x:g,y:m,width:c.width,height:c.height}}(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}},et={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e,o=l(r),[s]=t?Y(t.floating):[!1];if(r===o||s)return n;let c={scrollLeft:0,scrollTop:0},u=R(1),p=R(0),g=d(r);if((g||!g&&"fixed"!==a)&&(("body"!==i(r)||f(o))&&(c=E(r)),d(r))){let e=W(r);u=z(r),p.x=e.x+r.clientLeft,p.y=e.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+p.x,y:n.y*u.y-c.scrollTop*u.y+p.y}},getDocumentElement:l,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e,o=[..."clippingAncestors"===n?function(e,t){let n=t.get(e);if(n)return n;let r=S(e,[],!1).filter(e=>u(e)&&"body"!==i(e)),a=null,o="fixed"===y(e).position,s=o?v(e):e;for(;u(s)&&!h(s);){let t=y(s),n=g(s);n||"fixed"!==t.position||(a=null),(o?!n&&!a:!n&&"static"===t.position&&!!a&&["absolute","fixed"].includes(a.position)||f(s)&&!n&&function e(t,n){let r=v(t);return!(r===n||!u(r)||h(r))&&("fixed"===y(r).position||e(r,n))}(e,s))?r=r.filter(e=>e!==s):a=t,s=v(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=o[0],l=o.reduce((e,n)=>{let r=X(t,n,a);return e.top=w(r.top,e.top),e.right=T(r.right,e.right),e.bottom=T(r.bottom,e.bottom),e.left=w(r.left,e.left),e},X(t,s,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:J,getElementRects:ee,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:n}=j(e);return{width:t,height:n}},getScale:z,isElement:u,isRTL:function(e){return"rtl"===y(e).direction}};function en(e,t,n,r){let a;void 0===r&&(r={});let{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:u=!1}=r,d=$(e),p=o||i?[...d?S(d):[],...S(t)]:[];p.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});let f=d&&c?function(e,t){let n,r=null,a=l(e);function o(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return!function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();let{left:c,top:u,width:d,height:p}=e.getBoundingClientRect();if(s||t(),!d||!p)return;let f=k(u),g=k(a.clientWidth-(c+d)),m={rootMargin:-f+"px "+-g+"px "+-k(a.clientHeight-(u+p))+"px "+-k(c)+"px",threshold:w(0,T(1,l))||1},b=!0;function h(e){let t=e[0].intersectionRatio;if(t!==l){if(!b)return i();t?i(!1,t):n=setTimeout(()=>{i(!1,1e-7)},100)}b=!1}try{r=new IntersectionObserver(h,{...m,root:a.ownerDocument})}catch(e){r=new IntersectionObserver(h,m)}r.observe(e)}(!0),o}(d,n):null,g=-1,m=null;s&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),d&&!u&&m.observe(d),m.observe(t));let b=u?W(e):null;return u&&function t(){let r=W(e);b&&(r.x!==b.x||r.y!==b.y||r.width!==b.width||r.height!==b.height)&&n(),b=r,a=requestAnimationFrame(t)}(),n(),()=>{var e;p.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==f||f(),null==(e=m)||e.disconnect(),m=null,u&&cancelAnimationFrame(a)}}let er=(e,t,n)=>{let r=new Map,a={platform:et,...n},o={...a.platform,_c:r};return B(e,t,{...a,platform:o})};var ea="undefined"!=typeof document?r.useLayoutEffect:r.useEffect;function eo(e,t){let n,r,a;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!eo(e[r],t[r]))return!1;return!0}if((n=(a=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,a[r]))return!1;for(r=n;0!=r--;){let n=a[r];if(("_owner"!==n||!e.$$typeof)&&!eo(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function ei(e){let t=r.useRef(e);return ea(()=>{t.current=e}),t}var es="undefined"!=typeof document?r.useLayoutEffect:r.useEffect;let el=!1,ec=0,eu=()=>"floating-ui-"+ec++,ed=a["useId".toString()]||function(){let[e,t]=r.useState(()=>el?eu():void 0);return es(()=>{null==e&&t(eu())},[]),r.useEffect(()=>{el||(el=!0)},[]),e},ep=r.createContext(null),ef=r.createContext(null),eg=()=>{var e;return(null==(e=r.useContext(ep))?void 0:e.id)||null},em=()=>r.useContext(ef);function eb(e){return(null==e?void 0:e.ownerDocument)||document}function eh(e){return eb(e).defaultView||window}function ey(e){return!!e&&e instanceof eh(e).Element}function eE(e){return!!e&&e instanceof eh(e).HTMLElement}function ev(e,t){let n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function eS(e){let t=(0,r.useRef)(e);return es(()=>{t.current=e}),t}let eT="data-floating-ui-safe-polygon";function ew(e,t,n){return n&&!ev(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}let eA=function(e,t){let{enabled:n=!0,delay:a=0,handleClose:o=null,mouseOnly:i=!1,restMs:s=0,move:l=!0}=void 0===t?{}:t,{open:c,onOpenChange:u,dataRef:d,events:p,elements:{domReference:f,floating:g},refs:m}=e,b=em(),h=eg(),y=eS(o),E=eS(a),v=r.useRef(),S=r.useRef(),T=r.useRef(),w=r.useRef(),A=r.useRef(!0),k=r.useRef(!1),R=r.useRef(()=>{}),x=r.useCallback(()=>{var e;let t=null==(e=d.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t},[d]);r.useEffect(()=>{if(n)return p.on("dismiss",e),()=>{p.off("dismiss",e)};function e(){clearTimeout(S.current),clearTimeout(w.current),A.current=!0}},[n,p]),r.useEffect(()=>{if(!n||!y.current||!c)return;function e(){x()&&u(!1)}let t=eb(g).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[g,c,u,n,y,d,x]);let C=r.useCallback(function(e){void 0===e&&(e=!0);let t=ew(E.current,"close",v.current);t&&!T.current?(clearTimeout(S.current),S.current=setTimeout(()=>u(!1),t)):e&&(clearTimeout(S.current),u(!1))},[E,u]),N=r.useCallback(()=>{R.current(),T.current=void 0},[]),I=r.useCallback(()=>{if(k.current){let e=eb(m.floating.current).body;e.style.pointerEvents="",e.removeAttribute(eT),k.current=!1}},[m]);return r.useEffect(()=>{if(n&&ey(f))return c&&f.addEventListener("mouseleave",o),null==g||g.addEventListener("mouseleave",o),l&&f.addEventListener("mousemove",r,{once:!0}),f.addEventListener("mouseenter",r),f.addEventListener("mouseleave",a),()=>{c&&f.removeEventListener("mouseleave",o),null==g||g.removeEventListener("mouseleave",o),l&&f.removeEventListener("mousemove",r),f.removeEventListener("mouseenter",r),f.removeEventListener("mouseleave",a)};function t(){return!!d.current.openEvent&&["click","mousedown"].includes(d.current.openEvent.type)}function r(e){if(clearTimeout(S.current),A.current=!1,i&&!ev(v.current)||s>0&&0===ew(E.current,"open"))return;d.current.openEvent=e;let t=ew(E.current,"open",v.current);t?S.current=setTimeout(()=>{u(!0)},t):u(!0)}function a(n){if(t())return;R.current();let r=eb(g);if(clearTimeout(w.current),y.current){c||clearTimeout(S.current),T.current=y.current({...e,tree:b,x:n.clientX,y:n.clientY,onClose(){I(),N(),C()}});let t=T.current;r.addEventListener("mousemove",t),R.current=()=>{r.removeEventListener("mousemove",t)};return}C()}function o(n){t()||null==y.current||y.current({...e,tree:b,x:n.clientX,y:n.clientY,onClose(){I(),N(),C()}})(n)}},[f,g,n,e,i,s,l,C,N,I,u,c,b,E,y,d]),es(()=>{var e,t,r;if(n&&c&&null!=(e=y.current)&&e.__options.blockPointerEvents&&x()){let e=eb(g).body;if(e.setAttribute(eT,""),e.style.pointerEvents="none",k.current=!0,ey(f)&&g){let e=null==b?void 0:null==(t=b.nodesRef.current.find(e=>e.id===h))?void 0:null==(r=t.context)?void 0:r.elements.floating;return e&&(e.style.pointerEvents=""),f.style.pointerEvents="auto",g.style.pointerEvents="auto",()=>{f.style.pointerEvents="",g.style.pointerEvents=""}}}},[n,c,h,g,f,b,y,d,x]),es(()=>{c||(v.current=void 0,N(),I())},[c,N,I]),r.useEffect(()=>()=>{N(),clearTimeout(S.current),clearTimeout(w.current),I()},[n,N,I]),r.useMemo(()=>{if(!n)return{};function e(e){v.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(){c||0===s||(clearTimeout(w.current),w.current=setTimeout(()=>{A.current||u(!0)},s))}},floating:{onMouseEnter(){clearTimeout(S.current)},onMouseLeave(){p.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),C(!1)}}}},[p,n,s,c,u,C])};function ek(e,t){if(!e||!t)return!1;let n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&function(e){if("undefined"==typeof ShadowRoot)return!1;let t=eh(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}(n)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}function eR(e,t){let n=e.filter(e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})||[],r=n;for(;r.length;)r=e.filter(e=>{var t;return null==(t=r)?void 0:t.some(t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)})})||[],n=n.concat(r);return n}let ex=a["useInsertionEffect".toString()]||(e=>e());function eC(e){let t=r.useRef(()=>{});return ex(()=>{t.current=e}),r.useCallback(function(){for(var e=arguments.length,n=Array(e),r=0;r!1),w="function"==typeof f?T:f,A=r.useRef(!1),{escapeKeyBubbles:k,outsidePressBubbles:R}=eO(y);return r.useEffect(()=>{if(!n||!d)return;function e(e){if("Escape"===e.key){let e=E?eR(E.nodesRef.current,i):[];if(e.length>0){let t=!0;if(e.forEach(e=>{var n;if(null!=(n=e.context)&&n.open&&!e.context.dataRef.current.__escapeKeyBubbles){t=!1;return}}),!t)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),a(!1)}}function t(e){var t;let n=A.current;if(A.current=!1,n||"function"==typeof w&&!w(e))return;let r="composedPath"in e?e.composedPath()[0]:e.target;if(eE(r)&&c){let t=c.ownerDocument.defaultView||window,n=r.scrollWidth>r.clientWidth,a=r.scrollHeight>r.clientHeight,o=a&&e.offsetX>r.clientWidth;if(a&&"rtl"===t.getComputedStyle(r).direction&&(o=e.offsetX<=r.offsetWidth-r.clientWidth),o||n&&e.offsetY>r.clientHeight)return}let s=E&&eR(E.nodesRef.current,i).some(t=>{var n;return eN(e,null==(n=t.context)?void 0:n.elements.floating)});if(eN(e,c)||eN(e,l)||s)return;let u=E?eR(E.nodesRef.current,i):[];if(u.length>0){let e=!0;if(u.forEach(t=>{var n;if(null!=(n=t.context)&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:v?{preventScroll:!0}:function(e){if(0===e.mozInputSource&&e.isTrusted)return!0;let t=/Android/i;return(t.test(function(){let e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}())||t.test(function(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}(e)||0===(t=e).width&&0===t.height||1===t.width&&1===t.height&&0===t.pressure&&0===t.detail&&"mouse"!==t.pointerType||t.width<1&&t.height<1&&0===t.pressure&&0===t.detail}}),a(!1)}function r(){a(!1)}u.current.__escapeKeyBubbles=k,u.current.__outsidePressBubbles=R;let f=eb(c);p&&f.addEventListener("keydown",e),w&&f.addEventListener(g,t);let m=[];return h&&(ey(l)&&(m=S(l)),ey(c)&&(m=m.concat(S(c))),!ey(s)&&s&&s.contextElement&&(m=m.concat(S(s.contextElement)))),(m=m.filter(e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)})).forEach(e=>{e.addEventListener("scroll",r,{passive:!0})}),()=>{p&&f.removeEventListener("keydown",e),w&&f.removeEventListener(g,t),m.forEach(e=>{e.removeEventListener("scroll",r)})}},[u,c,l,s,p,w,g,o,E,i,n,a,h,d,k,R,v]),r.useEffect(()=>{A.current=!1},[w,g]),r.useMemo(()=>d?{reference:{[eI[b]]:()=>{m&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),a(!1))}},floating:{[e_[g]]:()=>{A.current=!0}}}:{},[d,o,m,g,b,a])},eP=function(e,t){let{open:n,onOpenChange:a,dataRef:o,events:i,refs:s,elements:{floating:l,domReference:c}}=e,{enabled:u=!0,keyboardOnly:d=!0}=void 0===t?{}:t,p=r.useRef(""),f=r.useRef(!1),g=r.useRef();return r.useEffect(()=>{if(!u)return;let e=eb(l).defaultView||window;function t(){!n&&eE(c)&&c===function(e){let t=e.activeElement;for(;(null==(n=t)?void 0:null==(r=n.shadowRoot)?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}(eb(c))&&(f.current=!0)}return e.addEventListener("blur",t),()=>{e.removeEventListener("blur",t)}},[l,c,n,u]),r.useEffect(()=>{if(u)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(e){("referencePress"===e.type||"escapeKey"===e.type)&&(f.current=!0)}},[i,u]),r.useEffect(()=>()=>{clearTimeout(g.current)},[]),r.useMemo(()=>u?{reference:{onPointerDown(e){let{pointerType:t}=e;p.current=t,f.current=!!(t&&d)},onMouseLeave(){f.current=!1},onFocus(e){var t;f.current||"focus"===e.type&&(null==(t=o.current.openEvent)?void 0:t.type)==="mousedown"&&o.current.openEvent&&eN(o.current.openEvent,c)||(o.current.openEvent=e.nativeEvent,a(!0))},onBlur(e){f.current=!1;let t=e.relatedTarget,n=ey(t)&&t.hasAttribute("data-floating-ui-focus-guard")&&"outside"===t.getAttribute("data-type");g.current=setTimeout(()=>{ek(s.floating.current,t)||ek(c,t)||n||a(!1)})}}}:{},[u,d,c,s,o,a])},eD=function(e,t){let{open:n}=e,{enabled:a=!0,role:o="dialog"}=void 0===t?{}:t,i=ed(),s=ed();return r.useMemo(()=>{let e={id:i,role:o};return a?"tooltip"===o?{reference:{"aria-describedby":n?i:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===o?"dialog":o,"aria-controls":n?i:void 0,..."listbox"===o&&{role:"combobox"},..."menu"===o&&{id:s}},floating:{...e,..."menu"===o&&{"aria-labelledby":s}}}:{}},[a,o,n,i,s])};function eM(e,t,n){let r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map(e=>e?e[n]:null).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(0===n.indexOf("on")){if(r.has(n)||r.set(n,[]),"function"==typeof a){var o;null==(o=r.get(n))||o.push(a),e[n]=function(){for(var e,t=arguments.length,a=Array(t),o=0;oe(...a))}}}else e[n]=a}),e),{})}}let eF=function(e){void 0===e&&(e=[]);let t=e,n=r.useCallback(t=>eM(t,e,"reference"),t),a=r.useCallback(t=>eM(t,e,"floating"),t),o=r.useCallback(t=>eM(t,e,"item"),e.map(e=>null==e?void 0:e.item));return r.useMemo(()=>({getReferenceProps:n,getFloatingProps:a,getItemProps:o}),[n,a,o])};var eU=n(99250);let eB=e=>{var t,n;let[a,i]=(0,r.useState)(!1),[s,l]=(0,r.useState)(),{x:c,y:u,refs:d,strategy:p,context:f}=function(e){void 0===e&&(e={});let{open:t=!1,onOpenChange:n,nodeId:a}=e,i=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:a=[],platform:i,whileElementsMounted:s,open:l}=e,[c,u]=r.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=r.useState(a);eo(d,a)||p(a);let f=r.useRef(null),g=r.useRef(null),m=r.useRef(c),b=ei(s),h=ei(i),[y,E]=r.useState(null),[v,S]=r.useState(null),T=r.useCallback(e=>{f.current!==e&&(f.current=e,E(e))},[]),w=r.useCallback(e=>{g.current!==e&&(g.current=e,S(e))},[]),A=r.useCallback(()=>{if(!f.current||!g.current)return;let e={placement:t,strategy:n,middleware:d};h.current&&(e.platform=h.current),er(f.current,g.current,e).then(e=>{let t={...e,isPositioned:!0};k.current&&!eo(m.current,t)&&(m.current=t,o.flushSync(()=>{u(t)}))})},[d,t,n,h]);ea(()=>{!1===l&&m.current.isPositioned&&(m.current.isPositioned=!1,u(e=>({...e,isPositioned:!1})))},[l]);let k=r.useRef(!1);ea(()=>(k.current=!0,()=>{k.current=!1}),[]),ea(()=>{if(y&&v){if(b.current)return b.current(y,v,A);A()}},[y,v,A,b]);let R=r.useMemo(()=>({reference:f,floating:g,setReference:T,setFloating:w}),[T,w]),x=r.useMemo(()=>({reference:y,floating:v}),[y,v]);return r.useMemo(()=>({...c,update:A,refs:R,elements:x,reference:T,floating:w}),[c,A,R,x,T,w])}(e),s=em(),l=r.useRef(null),c=r.useRef({}),u=r.useState(()=>(function(){let e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(e=>e!==n))}}})())[0],[d,p]=r.useState(null),f=r.useCallback(e=>{let t=ey(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;i.refs.setReference(t)},[i.refs]),g=r.useCallback(e=>{(ey(e)||null===e)&&(l.current=e,p(e)),(ey(i.refs.reference.current)||null===i.refs.reference.current||null!==e&&!ey(e))&&i.refs.setReference(e)},[i.refs]),m=r.useMemo(()=>({...i.refs,setReference:g,setPositionReference:f,domReference:l}),[i.refs,g,f]),b=r.useMemo(()=>({...i.elements,domReference:d}),[i.elements,d]),h=eC(n),y=r.useMemo(()=>({...i,refs:m,elements:b,dataRef:c,nodeId:a,events:u,open:t,onOpenChange:h}),[i,a,u,t,h,m,b]);return es(()=>{let e=null==s?void 0:s.nodesRef.current.find(e=>e.id===a);e&&(e.context=y)}),r.useMemo(()=>({...i,context:y,refs:m,reference:g,positionReference:f}),[i,m,y,g,f])}({open:a,onOpenChange:t=>{t&&e?l(setTimeout(()=>{i(t)},e)):(clearTimeout(s),i(t))},placement:"top",whileElementsMounted:en,middleware:[{name:"offset",options:5,async fn(e){var t,n;let{x:r,y:a,placement:o,middlewareData:i}=e,s=await Z(e,5);return o===(null==(t=i.offset)?void 0:t.placement)&&null!=(n=i.arrow)&&n.alignmentOffset?{}:{x:r+s.x,y:a+s.y,data:{...s,placement:o}}}},{name:"flip",options:t={fallbackAxisSideDirection:"start"},async fn(e){var n,r,a,o,i;let{placement:s,middlewareData:l,rects:c,initialPlacement:u,platform:d,elements:p}=e,{mainAxis:f=!0,crossAxis:g=!0,fallbackPlacements:m,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:y=!0,...E}=N(t,e);if(null!=(n=l.arrow)&&n.alignmentOffset)return{};let v=I(s),S=I(u)===u,T=await (null==d.isRTL?void 0:d.isRTL(p.floating)),w=m||(S||!y?[M(u)]:function(e){let t=M(e);return[D(e),t,D(t)]}(u));m||"none"===h||w.push(...function(e,t,n,r){let a=_(e),o=function(e,t,n){let r=["left","right"],a=["right","left"];switch(e){case"top":case"bottom":if(n)return t?a:r;return t?r:a;case"left":case"right":return t?["top","bottom"]:["bottom","top"];default:return[]}}(I(e),"start"===n,r);return a&&(o=o.map(e=>e+"-"+a),t&&(o=o.concat(o.map(D)))),o}(u,y,h,T));let A=[u,...w],k=await G(e,E),R=[],x=(null==(r=l.flip)?void 0:r.overflows)||[];if(f&&R.push(k[v]),g){let e=function(e,t,n){void 0===n&&(n=!1);let r=_(e),a=O(P(e)),o=L(a),i="x"===a?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=M(i)),[i,M(i)]}(s,c,T);R.push(k[e[0]],k[e[1]])}if(x=[...x,{placement:s,overflows:R}],!R.every(e=>e<=0)){let e=((null==(a=l.flip)?void 0:a.index)||0)+1,t=A[e];if(t)return{data:{index:e,overflows:x},reset:{placement:t}};let n=null==(o=x.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!n)switch(b){case"bestFit":{let e=null==(i=x.map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:i[0];e&&(n=e);break}case"initialPlacement":n=u}if(s!==n)return{reset:{placement:n}}}return{}}},(void 0===n&&(n={}),{name:"shift",options:n,async fn(e){let{x:t,y:r,placement:a}=e,{mainAxis:o=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=N(n,e),c={x:t,y:r},u=await G(e,l),d=P(I(a)),p=O(d),f=c[p],g=c[d];if(o){let e="y"===p?"top":"left",t="y"===p?"bottom":"right",n=f+u[e],r=f-u[t];f=w(n,T(f,r))}if(i){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",n=g+u[e],r=g-u[t];g=w(n,T(g,r))}let m=s.fn({...e,[p]:f,[d]:g});return{...m,data:{x:m.x-t,y:m.y-r}}}})]}),g=eA(f,{move:!1}),{getReferenceProps:m,getFloatingProps:b}=eF([g,eP(f),eL(f),eD(f,{role:"tooltip"})]);return{tooltipProps:{open:a,x:c,y:u,refs:d,strategy:p,getFloatingProps:b},getReferenceProps:m}},eG=e=>{let{text:t,open:n,x:a,y:o,refs:i,strategy:s,getFloatingProps:l}=e;return n&&t?r.createElement("div",Object.assign({className:(0,eU.q)("max-w-xs text-sm z-20 rounded-tremor-default opacity-100 px-2.5 py-1","text-white bg-tremor-background-emphasis","text-white dark:bg-dark-tremor-background-subtle"),ref:i.setFloating,style:{position:s,top:null!=o?o:0,left:null!=a?a:0}},l()),t):null};eG.displayName="Tooltip"},50027:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(64090),a=n(54942);n(99250);let o=(0,r.createContext)(a.fr.Blue)},18174:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(64090).createContext)(0)},21871:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(64090).createContext)(void 0)},41213:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(64090).createContext)({selectedValue:void 0,handleValueChange:void 0})},54942:function(e,t,n){n.d(t,{fr:function(){return a},m:function(){return s},u8:function(){return o},wu:function(){return r},zS:function(){return i}});let r={Increase:"increase",ModerateIncrease:"moderateIncrease",Decrease:"decrease",ModerateDecrease:"moderateDecrease",Unchanged:"unchanged"},a={Slate:"slate",Gray:"gray",Zinc:"zinc",Neutral:"neutral",Stone:"stone",Red:"red",Orange:"orange",Amber:"amber",Yellow:"yellow",Lime:"lime",Green:"green",Emerald:"emerald",Teal:"teal",Cyan:"cyan",Sky:"sky",Blue:"blue",Indigo:"indigo",Violet:"violet",Purple:"purple",Fuchsia:"fuchsia",Pink:"pink",Rose:"rose"},o={XS:"xs",SM:"sm",MD:"md",LG:"lg",XL:"xl"},i={Left:"left",Right:"right"},s={Top:"top",Bottom:"bottom"}},2898:function(e,t,n){n.d(t,{K:function(){return a},s:function(){return o}});var r=n(54942);let a={canvasBackground:50,lightBackground:100,background:500,darkBackground:600,darkestBackground:800,lightBorder:200,border:500,darkBorder:700,lightRing:200,ring:300,lightText:400,text:500,darkText:700,darkestText:900,icon:500},o=[r.fr.Blue,r.fr.Cyan,r.fr.Sky,r.fr.Indigo,r.fr.Violet,r.fr.Purple,r.fr.Fuchsia,r.fr.Slate,r.fr.Gray,r.fr.Zinc,r.fr.Neutral,r.fr.Stone,r.fr.Red,r.fr.Orange,r.fr.Amber,r.fr.Yellow,r.fr.Lime,r.fr.Green,r.fr.Emerald,r.fr.Teal,r.fr.Pink,r.fr.Rose]},99250:function(e,t,n){n.d(t,{q:function(){return F}});var r=/^\[(.+)\]$/;function a(e,t){var n=e;return t.split("-").forEach(function(e){n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n}var o=/\s+/;function i(){for(var e,t,n=0,r="";ne&&(t=0,r=n,n=new Map)}return{get:function(e){var t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(a(e,t),t):void 0},set:function(e,t){n.has(e)?n.set(e,t):a(e,t)}}}(e.cacheSize),splitModifiers:(n=1===(t=e.separator||":").length,o=t[0],i=t.length,function(e){for(var r,a=[],s=0,l=0,c=0;cl?r-l:void 0}}),...(u=e.theme,d=e.prefix,p={nextPart:new Map,validators:[]},(f=Object.entries(e.classGroups),d?f.map(function(e){return[e[0],e[1].map(function(e){return"string"==typeof e?d+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(function(e){return[d+e[0],e[1]]})):e})]}):f).forEach(function(e){var t=e[0];(function e(t,n,r,o){t.forEach(function(t){if("string"==typeof t){(""===t?n:a(n,t)).classGroupId=r;return}if("function"==typeof t){if(t.isThemeGetter){e(t(o),n,r,o);return}n.validators.push({validator:t,classGroupId:r});return}Object.entries(t).forEach(function(t){var i=t[0];e(t[1],a(n,i),r,o)})})})(e[1],p,t,u)}),s=e.conflictingClassGroups,c=void 0===(l=e.conflictingClassGroupModifiers)?{}:l,{getClassGroupId:function(e){var t=e.split("-");return""===t[0]&&1!==t.length&&t.shift(),function e(t,n){if(0===t.length)return n.classGroupId;var r,a=t[0],o=n.nextPart.get(a),i=o?e(t.slice(1),o):void 0;if(i)return i;if(0!==n.validators.length){var s=t.join("-");return null===(r=n.validators.find(function(e){return(0,e.validator)(s)}))||void 0===r?void 0:r.classGroupId}}(t,p)||function(e){if(r.test(e)){var t=r.exec(e)[1],n=null==t?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}(e)},getConflictingClassGroupIds:function(e,t){var n=s[e]||[];return t&&c[e]?[].concat(n,c[e]):n}})}}(l.slice(1).reduce(function(e,t){return t(e)},i()))).cache.get,n=e.cache.set,u=d,d(o)};function d(r){var a,i,s,l,c,u=t(r);if(u)return u;var d=(i=(a=e).splitModifiers,s=a.getClassGroupId,l=a.getConflictingClassGroupIds,c=new Set,r.trim().split(o).map(function(e){var t=i(e),n=t.modifiers,r=t.hasImportantModifier,a=t.baseClassName,o=t.maybePostfixModifierPosition,l=s(o?a.substring(0,o):a),c=!!o;if(!l){if(!o||!(l=s(a)))return{isTailwindClass:!1,originalClassName:e};c=!1}var u=(function(e){if(e.length<=1)return e;var t=[],n=[];return e.forEach(function(e){"["===e[0]?(t.push.apply(t,n.sort().concat([e])),n=[]):n.push(e)}),t.push.apply(t,n.sort()),t})(n).join(":");return{isTailwindClass:!0,modifierId:r?u+"!":u,classGroupId:l,originalClassName:e,hasPostfixModifier:c}}).reverse().filter(function(e){if(!e.isTailwindClass)return!0;var t=e.modifierId,n=e.classGroupId,r=e.hasPostfixModifier,a=t+n;return!c.has(a)&&(c.add(a),l(n,r).forEach(function(e){return c.add(t+e)}),!0)}).reverse().map(function(e){return e.originalClassName}).join(" "));return n(r,d),d}return function(){return u(i.apply(null,arguments))}}function l(e){var t=function(t){return t[e]||[]};return t.isThemeGetter=!0,t}var c=/^\[(?:([a-z-]+):)?(.+)\]$/i,u=/^\d+\/\d+$/,d=new Set(["px","full","screen"]),p=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,f=/\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$/,g=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;function m(e){return S(e)||d.has(e)||u.test(e)||b(e)}function b(e){return C(e,"length",N)}function h(e){return C(e,"size",I)}function y(e){return C(e,"position",I)}function E(e){return C(e,"url",_)}function v(e){return C(e,"number",S)}function S(e){return!Number.isNaN(Number(e))}function T(e){return e.endsWith("%")&&S(e.slice(0,-1))}function w(e){return O(e)||C(e,"number",O)}function A(e){return c.test(e)}function k(){return!0}function R(e){return p.test(e)}function x(e){return C(e,"",L)}function C(e,t,n){var r=c.exec(e);return!!r&&(r[1]?r[1]===t:n(r[2]))}function N(e){return f.test(e)}function I(){return!1}function _(e){return e.startsWith("url(")}function O(e){return Number.isInteger(Number(e))}function L(e){return g.test(e)}function P(){var e=l("colors"),t=l("spacing"),n=l("blur"),r=l("brightness"),a=l("borderColor"),o=l("borderRadius"),i=l("borderSpacing"),s=l("borderWidth"),c=l("contrast"),u=l("grayscale"),d=l("hueRotate"),p=l("invert"),f=l("gap"),g=l("gradientColorStops"),C=l("gradientColorStopPositions"),N=l("inset"),I=l("margin"),_=l("opacity"),O=l("padding"),L=l("saturate"),P=l("scale"),D=l("sepia"),M=l("skew"),F=l("space"),U=l("translate"),B=function(){return["auto","contain","none"]},G=function(){return["auto","hidden","clip","visible","scroll"]},Z=function(){return["auto",A,t]},j=function(){return[A,t]},$=function(){return["",m]},z=function(){return["auto",S,A]},H=function(){return["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"]},V=function(){return["solid","dashed","dotted","double","none"]},W=function(){return["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]},q=function(){return["start","end","center","between","around","evenly","stretch"]},Y=function(){return["","0",A]},K=function(){return["auto","avoid","all","avoid-page","page","left","right","column"]},X=function(){return[S,v]},Q=function(){return[S,A]};return{cacheSize:500,theme:{colors:[k],spacing:[m],blur:["none","",R,A],brightness:X(),borderColor:[e],borderRadius:["none","","full",R,A],borderSpacing:j(),borderWidth:$(),contrast:X(),grayscale:Y(),hueRotate:Q(),invert:Y(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[T,b],inset:Z(),margin:Z(),opacity:X(),padding:j(),saturate:X(),scale:X(),sepia:Y(),skew:Q(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",A]}],container:["container"],columns:[{columns:[R]}],"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"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[].concat(H(),[A])}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],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:["auto",w]}],basis:[{basis:Z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",A]}],grow:[{grow:Y()}],shrink:[{shrink:Y()}],order:[{order:["first","last","none",w]}],"grid-cols":[{"grid-cols":[k]}],"col-start-end":[{col:["auto",{span:["full",w]},A]}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":[k]}],"row-start-end":[{row:["auto",{span:[w]},A]}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",A]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",A]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal"].concat(q())}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal"].concat(q(),["baseline"])}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[].concat(q(),["baseline"])}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[O]}],px:[{px:[O]}],py:[{py:[O]}],ps:[{ps:[O]}],pe:[{pe:[O]}],pt:[{pt:[O]}],pr:[{pr:[O]}],pb:[{pb:[O]}],pl:[{pl:[O]}],m:[{m:[I]}],mx:[{mx:[I]}],my:[{my:[I]}],ms:[{ms:[I]}],me:[{me:[I]}],mt:[{mt:[I]}],mr:[{mr:[I]}],mb:[{mb:[I]}],ml:[{ml:[I]}],"space-x":[{"space-x":[F]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[F]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",A,t]}],"min-w":[{"min-w":["min","max","fit",A,m]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[R]},R,A]}],h:[{h:[A,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",A,m]}],"max-h":[{"max-h":[A,t,"min","max","fit"]}],"font-size":[{text:["base",R,b]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",v]}],"font-family":[{font:[k]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",A]}],"line-clamp":[{"line-clamp":["none",S,v]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",A,m]}],"list-image":[{"list-image":["none",A]}],"list-style-type":[{list:["none","disc","decimal",A]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[].concat(V(),["wavy"])}],"text-decoration-thickness":[{decoration:["auto","from-font",m]}],"underline-offset":[{"underline-offset":["auto",A,m]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",A]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",A]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[].concat(H(),[y])}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",h]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},E]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[].concat(V(),["hidden"])}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:V()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:[""].concat(V())}],"outline-offset":[{"outline-offset":[A,m]}],"outline-w":[{outline:[m]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[m]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",R,x]}],"shadow-color":[{shadow:[k]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":W()}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",R,A]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[p]}],saturate:[{saturate:[L]}],sepia:[{sepia:[D]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[L]}],"backdrop-sepia":[{"backdrop-sepia":[D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",A]}],duration:[{duration:Q()}],ease:[{ease:["linear","in","out","in-out",A]}],delay:[{delay:Q()}],animate:[{animate:["none","spin","ping","pulse","bounce",A]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[w,A]}],"translate-x":[{"translate-x":[U]}],"translate-y":[{"translate-y":[U]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",A]}],accent:[{accent:["auto",e]}],appearance:["appearance-none"],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",A]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],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","pinch-zoom","manipulation",{pan:["x","left","right","y","up","down"]}]}],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",A]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[m,v]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"]},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"],"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"],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-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-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"],"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"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}var D=Object.prototype.hasOwnProperty,M=new Set(["string","number","boolean"]);let F=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;ra.includes(e),i=(e,t)=>{if(t||e===r.wu.Unchanged)return e;switch(e){case r.wu.Increase:return r.wu.Decrease;case r.wu.ModerateIncrease:return r.wu.ModerateDecrease;case r.wu.Decrease:return r.wu.Increase;case r.wu.ModerateDecrease:return r.wu.ModerateIncrease}return""},s=e=>e.toString(),l=e=>e.reduce((e,t)=>e+t,0),c=(e,t)=>{for(let n=0;n{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}function d(e){return t=>"tremor-".concat(e,"-").concat(t)}function p(e,t){let n=o(e);if("white"===e||"black"===e||"transparent"===e||!t||!n){let t=e.includes("#")||e.includes("--")||e.includes("rgb")?"[".concat(e,"]"):e;return{bgColor:"bg-".concat(t),hoverBgColor:"hover:bg-".concat(t),selectBgColor:"ui-selected:bg-".concat(t),textColor:"text-".concat(t),selectTextColor:"ui-selected:text-".concat(t),hoverTextColor:"hover:text-".concat(t),borderColor:"border-".concat(t),selectBorderColor:"ui-selected:border-".concat(t),hoverBorderColor:"hover:border-".concat(t),ringColor:"ring-".concat(t),strokeColor:"stroke-".concat(t),fillColor:"fill-".concat(t)}}return{bgColor:"bg-".concat(e,"-").concat(t),selectBgColor:"ui-selected:bg-".concat(e,"-").concat(t),hoverBgColor:"hover:bg-".concat(e,"-").concat(t),textColor:"text-".concat(e,"-").concat(t),selectTextColor:"ui-selected:text-".concat(e,"-").concat(t),hoverTextColor:"hover:text-".concat(e,"-").concat(t),borderColor:"border-".concat(e,"-").concat(t),selectBorderColor:"ui-selected:border-".concat(e,"-").concat(t),hoverBorderColor:"hover:border-".concat(e,"-").concat(t),ringColor:"ring-".concat(e,"-").concat(t),strokeColor:"stroke-".concat(e,"-").concat(t),fillColor:"fill-".concat(e,"-").concat(t)}}},21467:function(e,t,n){n.d(t,{i:function(){return s}});var r=n(64090),a=n(44329),o=n(54165),i=n(57499);function s(e){return t=>r.createElement(o.ZP,{theme:{token:{motion:!1,zIndexPopupBase:0}}},r.createElement(e,Object.assign({},t)))}t.Z=(e,t,n,o)=>s(s=>{let{prefixCls:l,style:c}=s,u=r.useRef(null),[d,p]=r.useState(0),[f,g]=r.useState(0),[m,b]=(0,a.Z)(!1,{value:s.open}),{getPrefixCls:h}=r.useContext(i.E_),y=h(t||"select",l);r.useEffect(()=>{if(b(!0),"undefined"!=typeof ResizeObserver){let e=new ResizeObserver(e=>{let t=e[0].target;p(t.offsetHeight+8),g(t.offsetWidth)}),t=setInterval(()=>{var r;let a=n?".".concat(n(y)):".".concat(y,"-dropdown"),o=null===(r=u.current)||void 0===r?void 0:r.querySelector(a);o&&(clearInterval(t),e.observe(o))},10);return()=>{clearInterval(t),e.disconnect()}}},[]);let E=Object.assign(Object.assign({},s),{style:Object.assign(Object.assign({},c),{margin:0}),open:m,visible:m,getPopupContainer:()=>u.current});return o&&(E=o(E)),r.createElement("div",{ref:u,style:{paddingBottom:d,position:"relative",minWidth:f}},r.createElement(e,Object.assign({},E)))})},51761:function(e,t,n){n.d(t,{Cn:function(){return c},u6:function(){return i}});var r=n(64090),a=n(24750),o=n(86718);let i=1e3,s={Modal:100,Drawer:100,Popover:100,Popconfirm:100,Tooltip:100,Tour:100},l={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};function c(e,t){let[,n]=(0,a.ZP)(),c=r.useContext(o.Z);if(void 0!==t)return[t,t];let u=null!=c?c:0;return e in s?(u+=(c?0:n.zIndexPopupBase)+s[e],u=Math.min(u,n.zIndexPopupBase+i)):u+=l[e],[void 0===c?t:u,u]}},47387:function(e,t,n){n.d(t,{m:function(){return s}});let r=()=>({height:0,opacity:0}),a=e=>{let{scrollHeight:t}=e;return{height:t,opacity:1}},o=e=>({height:e?e.offsetHeight:0}),i=(e,t)=>(null==t?void 0:t.deadline)===!0||"height"===t.propertyName,s=(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]:"ant";return{motionName:"".concat(e,"-motion-collapse"),onAppearStart:r,onEnterStart:r,onAppearActive:a,onEnterActive:a,onLeaveStart:o,onLeaveActive:r,onAppearEnd:i,onEnterEnd:i,onLeaveEnd:i,motionDeadline:500}}},67966:function(e,t,n){n.d(t,{Z:function(){return s}});var r=n(89869);let a={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"]}},o={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 s(e){let{arrowWidth:t,autoAdjustOverflow:n,arrowPointAtCenter:s,offset:l,borderRadius:c,visibleFirst:u}=e,d=t/2,p={};return Object.keys(a).forEach(e=>{let f=Object.assign(Object.assign({},s&&o[e]||a[e]),{offset:[0,0],dynamicInset:!0});switch(p[e]=f,i.has(e)&&(f.autoArrow=!1),e){case"top":case"topLeft":case"topRight":f.offset[1]=-d-l;break;case"bottom":case"bottomLeft":case"bottomRight":f.offset[1]=d+l;break;case"left":case"leftTop":case"leftBottom":f.offset[0]=-d-l;break;case"right":case"rightTop":case"rightBottom":f.offset[0]=d+l}let g=(0,r.wZ)({contentRadius:c,limitVerticalRadius:!0});if(s)switch(e){case"topLeft":case"bottomLeft":f.offset[0]=-g.arrowOffsetHorizontal-d;break;case"topRight":case"bottomRight":f.offset[0]=g.arrowOffsetHorizontal+d;break;case"leftTop":case"rightTop":f.offset[1]=-g.arrowOffsetHorizontal-d;break;case"leftBottom":case"rightBottom":f.offset[1]=g.arrowOffsetHorizontal+d}f.overflow=function(e,t,n,r){if(!1===r)return{adjustX:!1,adjustY:!1};let a={};switch(e){case"top":case"bottom":a.shiftX=2*t.arrowOffsetHorizontal+n,a.shiftY=!0,a.adjustY=!0;break;case"left":case"right":a.shiftY=2*t.arrowOffsetVertical+n,a.shiftX=!0,a.adjustX=!0}let o=Object.assign(Object.assign({},a),r&&"object"==typeof r?r:{});return o.shiftX||(o.adjustX=!0),o.shiftY||(o.adjustY=!0),o}(e,g,t,n),u&&(f.htmlRegion="visibleFirst")}),p}},65823:function(e,t,n){n.d(t,{M2:function(){return i},Tm:function(){return s},l$:function(){return o}});var r,a=n(64090);let{isValidElement:o}=r||(r=n.t(a,2));function i(e){return e&&o(e)&&e.type===a.Fragment}function s(e,t){return o(e)?a.cloneElement(e,"function"==typeof t?t(e.props||{}):t):e}},76564:function(e,t,n){n.d(t,{G8:function(){return o},ln:function(){return i}});var r=n(64090);function a(){}n(53850);let o=r.createContext({}),i=()=>{let e=()=>{};return e.deprecated=a,e}},86718:function(e,t,n){let r=n(64090).createContext(void 0);t.Z=r},51350:function(e,t,n){n.d(t,{Te:function(){return c},aG:function(){return i},hU:function(){return u},nx:function(){return s}});var r=n(64090),a=n(65823);let o=/^[\u4e00-\u9fa5]{2}$/,i=o.test.bind(o);function s(e){return"danger"===e?{danger:!0}:{type:e}}function l(e){return"string"==typeof e}function c(e){return"text"===e||"link"===e}function u(e,t){let n=!1,o=[];return r.Children.forEach(e,e=>{let t=typeof e,r="string"===t||"number"===t;if(n&&r){let t=o.length-1,n=o[t];o[t]="".concat(n).concat(e)}else o.push(e);n=r}),r.Children.map(o,e=>(function(e,t){if(null==e)return;let n=t?" ":"";return"string"!=typeof e&&"number"!=typeof e&&l(e.type)&&i(e.props.children)?(0,a.Tm)(e,{children:e.props.children.split("").join(n)}):l(e)?i(e)?r.createElement("span",null,e.split("").join(n)):r.createElement("span",null,e):(0,a.M2)(e)?r.createElement("span",null,e):e})(e,t))}},1861:function(e,t,n){n.d(t,{ZP:function(){return eh}});var r=n(64090),a=n(16480),o=n.n(a),i=n(35704),s=n(74084),l=n(73193),c=n(57499),u=n(65823),d=n(76585);let p=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 0.3s ".concat(e.motionEaseInOut),"opacity 0.35s ".concat(e.motionEaseInOut)].join(",")}}}}};var f=(0,d.ZP)("Wave",e=>[p(e)]),g=n(48563),m=n(19223),b=n(49367),h=n(37274);function y(e){return e&&"#fff"!==e&&"#ffffff"!==e&&"rgb(255, 255, 255)"!==e&&"rgba(255, 255, 255, 1)"!==e&&function(e){let t=(e||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return!t||!t[1]||!t[2]||!t[3]||!(t[1]===t[2]&&t[2]===t[3])}(e)&&!/rgba\((?:\d*, ){3}0\)/.test(e)&&"transparent"!==e}let E="ant-wave-target";function v(e){return Number.isNaN(e)?0:e}let S=e=>{let{className:t,target:n,component:a}=e,i=r.useRef(null),[s,l]=r.useState(null),[c,u]=r.useState([]),[d,p]=r.useState(0),[f,g]=r.useState(0),[S,T]=r.useState(0),[w,A]=r.useState(0),[k,R]=r.useState(!1),x={left:d,top:f,width:S,height:w,borderRadius:c.map(e=>"".concat(e,"px")).join(" ")};function C(){let e=getComputedStyle(n);l(function(e){let{borderTopColor:t,borderColor:n,backgroundColor:r}=getComputedStyle(e);return y(t)?t:y(n)?n:y(r)?r:null}(n));let t="static"===e.position,{borderLeftWidth:r,borderTopWidth:a}=e;p(t?n.offsetLeft:v(-parseFloat(r))),g(t?n.offsetTop:v(-parseFloat(a))),T(n.offsetWidth),A(n.offsetHeight);let{borderTopLeftRadius:o,borderTopRightRadius:i,borderBottomLeftRadius:s,borderBottomRightRadius:c}=e;u([o,i,c,s].map(e=>v(parseFloat(e))))}if(s&&(x["--wave-color"]=s),r.useEffect(()=>{if(n){let e;let t=(0,m.Z)(()=>{C(),R(!0)});return"undefined"!=typeof ResizeObserver&&(e=new ResizeObserver(C)).observe(n),()=>{m.Z.cancel(t),null==e||e.disconnect()}}},[]),!k)return null;let N=("Checkbox"===a||"Radio"===a)&&(null==n?void 0:n.classList.contains(E));return r.createElement(b.ZP,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(e,t)=>{var n;if(t.deadline||"opacity"===t.propertyName){let e=null===(n=i.current)||void 0===n?void 0:n.parentElement;(0,h.v)(e).then(()=>{null==e||e.remove()})}return!1}},e=>{let{className:n}=e;return r.createElement("div",{ref:i,className:o()(t,{"wave-quick":N},n),style:x})})};var T=(e,t)=>{var n;let{component:a}=t;if("Checkbox"===a&&!(null===(n=e.querySelector("input"))||void 0===n?void 0:n.checked))return;let o=document.createElement("div");o.style.position="absolute",o.style.left="0px",o.style.top="0px",null==e||e.insertBefore(o,null==e?void 0:e.firstChild),(0,h.s)(r.createElement(S,Object.assign({},t,{target:e})),o)},w=n(24750),A=e=>{let{children:t,disabled:n,component:a}=e,{getPrefixCls:i}=(0,r.useContext)(c.E_),d=(0,r.useRef)(null),p=i("wave"),[,b]=f(p),h=function(e,t,n){let{wave:a}=r.useContext(c.E_),[,o,i]=(0,w.ZP)(),s=(0,g.zX)(r=>{let s=e.current;if((null==a?void 0:a.disabled)||!s)return;let l=s.querySelector(".".concat(E))||s,{showEffect:c}=a||{};(c||T)(l,{className:t,token:o,component:n,event:r,hashId:i})}),l=r.useRef();return e=>{m.Z.cancel(l.current),l.current=(0,m.Z)(()=>{s(e)})}}(d,o()(p,b),a);if(r.useEffect(()=>{let e=d.current;if(!e||1!==e.nodeType||n)return;let t=t=>{!(0,l.Z)(t.target)||!e.getAttribute||e.getAttribute("disabled")||e.disabled||e.className.includes("disabled")||e.className.includes("-leave")||h(t)};return e.addEventListener("click",t,!0),()=>{e.removeEventListener("click",t,!0)}},[n]),!r.isValidElement(t))return null!=t?t:null;let y=(0,s.Yr)(t)?(0,s.sQ)(t.ref,d):d;return(0,u.Tm)(t,{ref:y})},k=n(17094),R=n(10693),x=n(92801),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 a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let N=r.createContext(void 0);var I=n(51350);let _=(0,r.forwardRef)((e,t)=>{let{className:n,style:a,children:i,prefixCls:s}=e,l=o()("".concat(s,"-icon"),n);return r.createElement("span",{ref:t,className:l,style:a},i)});var O=n(66155);let L=(0,r.forwardRef)((e,t)=>{let{prefixCls:n,className:a,style:i,iconClassName:s}=e,l=o()("".concat(n,"-loading-icon"),a);return r.createElement(_,{prefixCls:n,className:l,style:i,ref:t},r.createElement(O.Z,{className:s}))}),P=()=>({width:0,opacity:0,transform:"scale(0)"}),D=e=>({width:e.scrollWidth,opacity:1,transform:"scale(1)"});var M=e=>{let{prefixCls:t,loading:n,existIcon:a,className:o,style:i}=e,s=!!n;return a?r.createElement(L,{prefixCls:t,className:o,style:i}):r.createElement(b.ZP,{visible:s,motionName:"".concat(t,"-loading-icon-motion"),motionLeave:s,removeOnLeave:!0,onAppearStart:P,onAppearActive:D,onEnterStart:P,onEnterActive:D,onLeaveStart:D,onLeaveActive:P},(e,n)=>{let{className:a,style:s}=e;return r.createElement(L,{prefixCls:t,className:o,style:Object.assign(Object.assign({},i),s),ref:n,iconClassName:a})})},F=n(8985),U=n(11303),B=n(80316);let G=(e,t)=>({["> span, > ".concat(e)]:{"&:not(:last-child)":{["&, & > ".concat(e)]:{"&:not(:disabled)":{borderInlineEndColor:t}}},"&:not(:first-child)":{["&, & > ".concat(e)]:{"&:not(:disabled)":{borderInlineStartColor:t}}}}});var Z=e=>{let{componentCls:t,fontSize:n,lineWidth:r,groupBorderColor:a,colorErrorHover:o}=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,\n &:focus,\n &:active":{zIndex:2},"&[disabled]":{zIndex:0}},["".concat(t,"-icon-only")]:{fontSize:n}},G("".concat(t,"-primary"),a),G("".concat(t,"-danger"),o)]}},j=n(49202);let $=e=>{let{paddingInline:t,onlyIconSize:n,paddingBlock:r}=e;return(0,B.TS)(e,{buttonPaddingHorizontal:t,buttonPaddingVertical:r,buttonIconOnlyFontSize:n})},z=e=>{var t,n,r,a,o,i;let s=null!==(t=e.contentFontSize)&&void 0!==t?t:e.fontSize,l=null!==(n=e.contentFontSizeSM)&&void 0!==n?n:e.fontSize,c=null!==(r=e.contentFontSizeLG)&&void 0!==r?r:e.fontSizeLG,u=null!==(a=e.contentLineHeight)&&void 0!==a?a:(0,j.D)(s),d=null!==(o=e.contentLineHeightSM)&&void 0!==o?o:(0,j.D)(l),p=null!==(i=e.contentLineHeightLG)&&void 0!==i?i:(0,j.D)(c);return{fontWeight:400,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:e.fontSizeLG,onlyIconSizeSM:e.fontSizeLG-2,onlyIconSizeLG:e.fontSizeLG+2,groupBorderColor:e.colorPrimaryHover,linkHoverBg:"transparent",textHoverBg:e.colorBgTextHover,defaultColor:e.colorText,defaultBg:e.colorBgContainer,defaultBorderColor:e.colorBorder,defaultBorderColorDisabled:e.colorBorder,contentFontSize:s,contentFontSizeSM:l,contentFontSizeLG:c,contentLineHeight:u,contentLineHeightSM:d,contentLineHeightLG:p,paddingBlock:Math.max((e.controlHeight-s*u)/2-e.lineWidth,0),paddingBlockSM:Math.max((e.controlHeightSM-l*d)/2-e.lineWidth,0),paddingBlockLG:Math.max((e.controlHeightLG-c*p)/2-e.lineWidth,0)}},H=e=>{let{componentCls:t,iconCls:n,fontWeight:r}=e;return{[t]:{outline:"none",position:"relative",display:"inline-block",fontWeight:r,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",background:"transparent",border:"".concat((0,F.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"},"> span":{display:"inline-block"},["".concat(t,"-icon")]:{lineHeight:0},["> ".concat(n," + span, > span + ").concat(n)]:{marginInlineStart:e.marginXS},["&:not(".concat(t,"-icon-only) > ").concat(t,"-icon")]:{["&".concat(t,"-loading-icon, &:not(:last-child)")]:{marginInlineEnd:e.marginXS}},"> a":{color:"currentColor"},"&:not(:disabled)":Object.assign({},(0,U.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"},["&-icon-only".concat(t,"-compact-item")]:{flex:"none"}}}},V=(e,t,n)=>({["&:not(:disabled):not(".concat(e,"-disabled)")]:{"&:hover":t,"&:active":n}}),W=e=>({minWidth:e.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:"50%"}),q=e=>({borderRadius:e.controlHeight,paddingInlineStart:e.calc(e.controlHeight).div(2).equal(),paddingInlineEnd:e.calc(e.controlHeight).div(2).equal()}),Y=e=>({cursor:"not-allowed",borderColor:e.borderColorDisabled,color:e.colorTextDisabled,background:e.colorBgContainerDisabled,boxShadow:"none"}),K=(e,t,n,r,a,o,i,s)=>({["&".concat(e,"-background-ghost")]:Object.assign(Object.assign({color:n||void 0,background:t,borderColor:r||void 0,boxShadow:"none"},V(e,Object.assign({background:t},i),Object.assign({background:t},s))),{"&:disabled":{cursor:"not-allowed",color:a||void 0,borderColor:o||void 0}})}),X=e=>({["&:disabled, &".concat(e.componentCls,"-disabled")]:Object.assign({},Y(e))}),Q=e=>Object.assign({},X(e)),J=e=>({["&:disabled, &".concat(e.componentCls,"-disabled")]:{cursor:"not-allowed",color:e.colorTextDisabled}}),ee=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Q(e)),{background:e.defaultBg,borderColor:e.defaultBorderColor,color:e.defaultColor,boxShadow:e.defaultShadow}),V(e.componentCls,{color:e.colorPrimaryHover,borderColor:e.colorPrimaryHover},{color:e.colorPrimaryActive,borderColor:e.colorPrimaryActive})),K(e.componentCls,e.ghostBg,e.defaultGhostColor,e.defaultGhostBorderColor,e.colorTextDisabled,e.colorBorder)),{["&".concat(e.componentCls,"-dangerous")]:Object.assign(Object.assign(Object.assign({color:e.colorError,borderColor:e.colorError},V(e.componentCls,{color:e.colorErrorHover,borderColor:e.colorErrorBorderHover},{color:e.colorErrorActive,borderColor:e.colorErrorActive})),K(e.componentCls,e.ghostBg,e.colorError,e.colorError,e.colorTextDisabled,e.colorBorder)),X(e))}),et=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Q(e)),{color:e.primaryColor,background:e.colorPrimary,boxShadow:e.primaryShadow}),V(e.componentCls,{color:e.colorTextLightSolid,background:e.colorPrimaryHover},{color:e.colorTextLightSolid,background:e.colorPrimaryActive})),K(e.componentCls,e.ghostBg,e.colorPrimary,e.colorPrimary,e.colorTextDisabled,e.colorBorder,{color:e.colorPrimaryHover,borderColor:e.colorPrimaryHover},{color:e.colorPrimaryActive,borderColor:e.colorPrimaryActive})),{["&".concat(e.componentCls,"-dangerous")]:Object.assign(Object.assign(Object.assign({background:e.colorError,boxShadow:e.dangerShadow,color:e.dangerColor},V(e.componentCls,{background:e.colorErrorHover},{background:e.colorErrorActive})),K(e.componentCls,e.ghostBg,e.colorError,e.colorError,e.colorTextDisabled,e.colorBorder,{color:e.colorErrorHover,borderColor:e.colorErrorHover},{color:e.colorErrorActive,borderColor:e.colorErrorActive})),X(e))}),en=e=>Object.assign(Object.assign({},ee(e)),{borderStyle:"dashed"}),er=e=>Object.assign(Object.assign(Object.assign({color:e.colorLink},V(e.componentCls,{color:e.colorLinkHover,background:e.linkHoverBg},{color:e.colorLinkActive})),J(e)),{["&".concat(e.componentCls,"-dangerous")]:Object.assign(Object.assign({color:e.colorError},V(e.componentCls,{color:e.colorErrorHover},{color:e.colorErrorActive})),J(e))}),ea=e=>Object.assign(Object.assign(Object.assign({},V(e.componentCls,{color:e.colorText,background:e.textHoverBg},{color:e.colorText,background:e.colorBgTextActive})),J(e)),{["&".concat(e.componentCls,"-dangerous")]:Object.assign(Object.assign({color:e.colorError},J(e)),V(e.componentCls,{color:e.colorErrorHover,background:e.colorErrorBg},{color:e.colorErrorHover,background:e.colorErrorBg}))}),eo=e=>{let{componentCls:t}=e;return{["".concat(t,"-default")]:ee(e),["".concat(t,"-primary")]:et(e),["".concat(t,"-dashed")]:en(e),["".concat(t,"-link")]:er(e),["".concat(t,"-text")]:ea(e),["".concat(t,"-ghost")]:K(e.componentCls,e.ghostBg,e.colorBgContainer,e.colorBgContainer,e.colorTextDisabled,e.colorBorder)}},ei=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",{componentCls:n,controlHeight:r,fontSize:a,lineHeight:o,borderRadius:i,buttonPaddingHorizontal:s,iconCls:l,buttonPaddingVertical:c}=e,u="".concat(n,"-icon-only");return[{["".concat(n).concat(t)]:{fontSize:a,lineHeight:o,height:r,padding:"".concat((0,F.bf)(c)," ").concat((0,F.bf)(s)),borderRadius:i,["&".concat(u)]:{width:r,paddingInlineStart:0,paddingInlineEnd:0,["&".concat(n,"-round")]:{width:"auto"},[l]:{fontSize:e.buttonIconOnlyFontSize}},["&".concat(n,"-loading")]:{opacity:e.opacityLoading,cursor:"default"},["".concat(n,"-loading-icon")]:{transition:"width ".concat(e.motionDurationSlow," ").concat(e.motionEaseInOut,", opacity ").concat(e.motionDurationSlow," ").concat(e.motionEaseInOut)}}},{["".concat(n).concat(n,"-circle").concat(t)]:W(e)},{["".concat(n).concat(n,"-round").concat(t)]:q(e)}]},es=e=>ei((0,B.TS)(e,{fontSize:e.contentFontSize,lineHeight:e.contentLineHeight})),el=e=>ei((0,B.TS)(e,{controlHeight:e.controlHeightSM,fontSize:e.contentFontSizeSM,lineHeight:e.contentLineHeightSM,padding:e.paddingXS,buttonPaddingHorizontal:e.paddingInlineSM,buttonPaddingVertical:e.paddingBlockSM,borderRadius:e.borderRadiusSM,buttonIconOnlyFontSize:e.onlyIconSizeSM}),"".concat(e.componentCls,"-sm")),ec=e=>ei((0,B.TS)(e,{controlHeight:e.controlHeightLG,fontSize:e.contentFontSizeLG,lineHeight:e.contentLineHeightLG,buttonPaddingHorizontal:e.paddingInlineLG,buttonPaddingVertical:e.paddingBlockLG,borderRadius:e.borderRadiusLG,buttonIconOnlyFontSize:e.onlyIconSizeLG}),"".concat(e.componentCls,"-lg")),eu=e=>{let{componentCls:t}=e;return{[t]:{["&".concat(t,"-block")]:{width:"100%"}}}};var ed=(0,d.I$)("Button",e=>{let t=$(e);return[H(t),el(t),es(t),ec(t),eu(t),eo(t),Z(t)]},z,{unitless:{fontWeight:!0,contentLineHeight:!0,contentLineHeightSM:!0,contentLineHeightLG:!0}}),ep=n(12288);let ef=e=>{let{componentCls:t,calc:n}=e;return{[t]:{["&-compact-item".concat(t,"-primary")]:{["&:not([disabled]) + ".concat(t,"-compact-item").concat(t,"-primary:not([disabled])")]:{position:"relative","&:before":{position:"absolute",top:n(e.lineWidth).mul(-1).equal(),insetInlineStart:n(e.lineWidth).mul(-1).equal(),display:"inline-block",width:e.lineWidth,height:"calc(100% + ".concat((0,F.bf)(e.lineWidth)," * 2)"),backgroundColor:e.colorPrimaryHover,content:'""'}}},"&-compact-vertical-item":{["&".concat(t,"-primary")]:{["&:not([disabled]) + ".concat(t,"-compact-vertical-item").concat(t,"-primary:not([disabled])")]:{position:"relative","&:before":{position:"absolute",top:n(e.lineWidth).mul(-1).equal(),insetInlineStart:n(e.lineWidth).mul(-1).equal(),display:"inline-block",width:"calc(100% + ".concat((0,F.bf)(e.lineWidth)," * 2)"),height:e.lineWidth,backgroundColor:e.colorPrimaryHover,content:'""'}}}}}}};var eg=(0,d.bk)(["Button","compact"],e=>{let t=$(e);return[(0,ep.c)(t),function(e){var t;let n="".concat(e.componentCls,"-compact-vertical");return{[n]:Object.assign(Object.assign({},{["&-item:not(".concat(n,"-last-item)")]:{marginBottom:e.calc(e.lineWidth).mul(-1).equal()},"&-item":{"&:hover,&:focus,&:active":{zIndex:2},"&[disabled]":{zIndex:0}}}),(t=e.componentCls,{["&-item:not(".concat(n,"-first-item):not(").concat(n,"-last-item)")]:{borderRadius:0},["&-item".concat(n,"-first-item:not(").concat(n,"-last-item)")]:{["&, &".concat(t,"-sm, &").concat(t,"-lg")]:{borderEndEndRadius:0,borderEndStartRadius:0}},["&-item".concat(n,"-last-item:not(").concat(n,"-first-item)")]:{["&, &".concat(t,"-sm, &").concat(t,"-lg")]:{borderStartStartRadius:0,borderStartEndRadius:0}}}))}}(t),ef(t)]},z),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 a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let eb=(0,r.forwardRef)((e,t)=>{var n,a;let{loading:l=!1,prefixCls:u,type:d="default",danger:p,shape:f="default",size:g,styles:m,disabled:b,className:h,rootClassName:y,children:E,icon:v,ghost:S=!1,block:T=!1,htmlType:w="button",classNames:C,style:O={}}=e,L=em(e,["loading","prefixCls","type","danger","shape","size","styles","disabled","className","rootClassName","children","icon","ghost","block","htmlType","classNames","style"]),{getPrefixCls:P,autoInsertSpaceInButton:D,direction:F,button:U}=(0,r.useContext)(c.E_),B=P("btn",u),[G,Z,j]=ed(B),$=(0,r.useContext)(k.Z),z=null!=b?b:$,H=(0,r.useContext)(N),V=(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}})(l),[l]),[W,q]=(0,r.useState)(V.loading),[Y,K]=(0,r.useState)(!1),X=(0,r.createRef)(),Q=(0,s.sQ)(t,X),J=1===r.Children.count(E)&&!v&&!(0,I.Te)(d);(0,r.useEffect)(()=>{let e=null;return V.delay>0?e=setTimeout(()=>{e=null,q(!0)},V.delay):q(V.loading),function(){e&&(clearTimeout(e),e=null)}},[V]),(0,r.useEffect)(()=>{if(!Q||!Q.current||!1===D)return;let e=Q.current.textContent;J&&(0,I.aG)(e)?Y||K(!0):Y&&K(!1)},[Q]);let ee=t=>{let{onClick:n}=e;if(W||z){t.preventDefault();return}null==n||n(t)},et=!1!==D,{compactSize:en,compactItemClassnames:er}=(0,x.ri)(B,F),ea=(0,R.Z)(e=>{var t,n;return null!==(n=null!==(t=null!=g?g:en)&&void 0!==t?t:H)&&void 0!==n?n:e}),eo=ea&&({large:"lg",small:"sm",middle:void 0})[ea]||"",ei=W?"loading":v,es=(0,i.Z)(L,["navigate"]),el=o()(B,Z,j,{["".concat(B,"-").concat(f)]:"default"!==f&&f,["".concat(B,"-").concat(d)]:d,["".concat(B,"-").concat(eo)]:eo,["".concat(B,"-icon-only")]:!E&&0!==E&&!!ei,["".concat(B,"-background-ghost")]:S&&!(0,I.Te)(d),["".concat(B,"-loading")]:W,["".concat(B,"-two-chinese-chars")]:Y&&et&&!W,["".concat(B,"-block")]:T,["".concat(B,"-dangerous")]:!!p,["".concat(B,"-rtl")]:"rtl"===F},er,h,y,null==U?void 0:U.className),ec=Object.assign(Object.assign({},null==U?void 0:U.style),O),eu=o()(null==C?void 0:C.icon,null===(n=null==U?void 0:U.classNames)||void 0===n?void 0:n.icon),ep=Object.assign(Object.assign({},(null==m?void 0:m.icon)||{}),(null===(a=null==U?void 0:U.styles)||void 0===a?void 0:a.icon)||{}),ef=v&&!W?r.createElement(_,{prefixCls:B,className:eu,style:ep},v):r.createElement(M,{existIcon:!!v,prefixCls:B,loading:!!W}),eb=E||0===E?(0,I.hU)(E,J&&et):null;if(void 0!==es.href)return G(r.createElement("a",Object.assign({},es,{className:o()(el,{["".concat(B,"-disabled")]:z}),href:z?void 0:es.href,style:ec,onClick:ee,ref:Q,tabIndex:z?-1:0}),ef,eb));let eh=r.createElement("button",Object.assign({},L,{type:w,className:el,style:ec,onClick:ee,disabled:z,ref:Q}),ef,eb,!!er&&r.createElement(eg,{key:"compact",prefixCls:B}));return(0,I.Te)(d)||(eh=r.createElement(A,{component:"Button",disabled:!!W},eh)),G(eh)});eb.Group=e=>{let{getPrefixCls:t,direction:n}=r.useContext(c.E_),{prefixCls:a,size:i,className:s}=e,l=C(e,["prefixCls","size","className"]),u=t("btn-group",a),[,,d]=(0,w.ZP)(),p="";switch(i){case"large":p="lg";break;case"small":p="sm"}let f=o()(u,{["".concat(u,"-").concat(p)]:p,["".concat(u,"-rtl")]:"rtl"===n},s,d);return r.createElement(N.Provider,{value:i},r.createElement("div",Object.assign({},l,{className:f})))},eb.__ANT_BUTTON=!0;var eh=eb},17094:function(e,t,n){n.d(t,{n:function(){return o}});var r=n(64090);let a=r.createContext(!1),o=e=>{let{children:t,disabled:n}=e,o=r.useContext(a);return r.createElement(a.Provider,{value:null!=n?n:o},t)};t.Z=a},97303:function(e,t,n){n.d(t,{q:function(){return o}});var r=n(64090);let a=r.createContext(void 0),o=e=>{let{children:t,size:n}=e,o=r.useContext(a);return r.createElement(a.Provider,{value:n||o},t)};t.Z=a},57499:function(e,t,n){n.d(t,{E_:function(){return o},oR:function(){return a}});var r=n(64090);let a="anticon",o=r.createContext({getPrefixCls:(e,t)=>t||(e?"ant-".concat(e):"ant"),iconPrefixCls:a}),{Consumer:i}=o},92935:function(e,t,n){var r=n(24750);t.Z=e=>{let[,,,,t]=(0,r.ZP)();return t?"".concat(e,"-css-var"):""}},10693:function(e,t,n){var r=n(64090),a=n(97303);t.Z=e=>{let t=r.useContext(a.Z);return r.useMemo(()=>e?"string"==typeof e?null!=e?e:t:e instanceof Function?e(t):t:t,[e,t])}},54165:function(e,t,n){let r,a,o,i;n.d(t,{ZP:function(){return z},w6:function(){return Z}});var s=n(64090),l=n.t(s,2),c=n(8985),u=n(67689),d=n(61475),p=n(36597),f=n(76564),g=n(12519),m=n(4678),b=n(33302),h=e=>{let{locale:t={},children:n,_ANT_MARK__:r}=e;s.useEffect(()=>(0,m.f)(t&&t.Modal),[t]);let a=s.useMemo(()=>Object.assign(Object.assign({},t),{exist:!0}),[t]);return s.createElement(b.Z.Provider,{value:a},n)},y=n(79474),E=n(43345),v=n(46864),S=n(57499),T=n(12215),w=n(6336),A=n(22127),k=n(24050);let R="-ant-".concat(Date.now(),"-").concat(Math.random());var x=n(17094),C=n(97303),N=n(92536);let{useId:I}=Object.assign({},l);var _=void 0===I?()=>"":I,O=n(49367),L=n(24750);function P(e){let{children:t}=e,[,n]=(0,L.ZP)(),{motion:r}=n,a=s.useRef(!1);return(a.current=a.current||!1===r,a.current)?s.createElement(O.zt,{motion:r},t):t}var D=()=>null,M=n(28030),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 a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let U=["getTargetContainer","getPopupContainer","renderEmpty","pageHeader","input","pagination","form","select","button"];function B(){return r||"ant"}function G(){return a||S.oR}let Z=()=>({getPrefixCls:(e,t)=>t||(e?"".concat(B(),"-").concat(e):B()),getIconPrefixCls:G,getRootPrefixCls:()=>r||B(),getTheme:()=>o,holderRender:i}),j=e=>{let{children:t,csp:n,autoInsertSpaceInButton:r,alert:a,anchor:o,form:i,locale:l,componentSize:m,direction:b,space:T,virtual:w,dropdownMatchSelectWidth:A,popupMatchSelectWidth:k,popupOverflow:R,legacyLocale:I,parentContext:O,iconPrefixCls:L,theme:B,componentDisabled:G,segmented:Z,statistic:j,spin:$,calendar:z,carousel:H,cascader:V,collapse:W,typography:q,checkbox:Y,descriptions:K,divider:X,drawer:Q,skeleton:J,steps:ee,image:et,layout:en,list:er,mentions:ea,modal:eo,progress:ei,result:es,slider:el,breadcrumb:ec,menu:eu,pagination:ed,input:ep,empty:ef,badge:eg,radio:em,rate:eb,switch:eh,transfer:ey,avatar:eE,message:ev,tag:eS,table:eT,card:ew,tabs:eA,timeline:ek,timePicker:eR,upload:ex,notification:eC,tree:eN,colorPicker:eI,datePicker:e_,rangePicker:eO,flex:eL,wave:eP,dropdown:eD,warning:eM}=e,eF=s.useCallback((t,n)=>{let{prefixCls:r}=e;if(n)return n;let a=r||O.getPrefixCls("");return t?"".concat(a,"-").concat(t):a},[O.getPrefixCls,e.prefixCls]),eU=L||O.iconPrefixCls||S.oR,eB=n||O.csp;(0,M.Z)(eU,eB);let eG=function(e,t){(0,f.ln)("ConfigProvider");let n=e||{},r=!1!==n.inherit&&t?t:E.u_,a=_();return(0,d.Z)(()=>{var o,i;if(!e)return t;let s=Object.assign({},r.components);Object.keys(e.components||{}).forEach(t=>{s[t]=Object.assign(Object.assign({},s[t]),e.components[t])});let l="css-var-".concat(a.replace(/:/g,"")),c=(null!==(o=n.cssVar)&&void 0!==o?o:r.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:"ant"},"object"==typeof r.cssVar?r.cssVar:{}),"object"==typeof n.cssVar?n.cssVar:{}),{key:"object"==typeof n.cssVar&&(null===(i=n.cssVar)||void 0===i?void 0:i.key)||l});return Object.assign(Object.assign(Object.assign({},r),n),{token:Object.assign(Object.assign({},r.token),n.token),components:s,cssVar:c})},[n,r],(e,t)=>e.some((e,n)=>{let r=t[n];return!(0,N.Z)(e,r,!0)}))}(B,O.theme),eZ={csp:eB,autoInsertSpaceInButton:r,alert:a,anchor:o,locale:l||I,direction:b,space:T,virtual:w,popupMatchSelectWidth:null!=k?k:A,popupOverflow:R,getPrefixCls:eF,iconPrefixCls:eU,theme:eG,segmented:Z,statistic:j,spin:$,calendar:z,carousel:H,cascader:V,collapse:W,typography:q,checkbox:Y,descriptions:K,divider:X,drawer:Q,skeleton:J,steps:ee,image:et,input:ep,layout:en,list:er,mentions:ea,modal:eo,progress:ei,result:es,slider:el,breadcrumb:ec,menu:eu,pagination:ed,empty:ef,badge:eg,radio:em,rate:eb,switch:eh,transfer:ey,avatar:eE,message:ev,tag:eS,table:eT,card:ew,tabs:eA,timeline:ek,timePicker:eR,upload:ex,notification:eC,tree:eN,colorPicker:eI,datePicker:e_,rangePicker:eO,flex:eL,wave:eP,dropdown:eD,warning:eM},ej=Object.assign({},O);Object.keys(eZ).forEach(e=>{void 0!==eZ[e]&&(ej[e]=eZ[e])}),U.forEach(t=>{let n=e[t];n&&(ej[t]=n)});let e$=(0,d.Z)(()=>ej,ej,(e,t)=>{let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length||n.some(n=>e[n]!==t[n])}),ez=s.useMemo(()=>({prefixCls:eU,csp:eB}),[eU,eB]),eH=s.createElement(s.Fragment,null,s.createElement(D,{dropdownMatchSelectWidth:A}),t),eV=s.useMemo(()=>{var e,t,n,r;return(0,p.T)((null===(e=y.Z.Form)||void 0===e?void 0:e.defaultValidateMessages)||{},(null===(n=null===(t=e$.locale)||void 0===t?void 0:t.Form)||void 0===n?void 0:n.defaultValidateMessages)||{},(null===(r=e$.form)||void 0===r?void 0:r.validateMessages)||{},(null==i?void 0:i.validateMessages)||{})},[e$,null==i?void 0:i.validateMessages]);Object.keys(eV).length>0&&(eH=s.createElement(g.Z.Provider,{value:eV},eH)),l&&(eH=s.createElement(h,{locale:l,_ANT_MARK__:"internalMark"},eH)),(eU||eB)&&(eH=s.createElement(u.Z.Provider,{value:ez},eH)),m&&(eH=s.createElement(C.q,{size:m},eH)),eH=s.createElement(P,null,eH);let eW=s.useMemo(()=>{let e=eG||{},{algorithm:t,token:n,components:r,cssVar:a}=e,o=F(e,["algorithm","token","components","cssVar"]),i=t&&(!Array.isArray(t)||t.length>0)?(0,c.jG)(t):E.uH,s={};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,c.jG)(r.algorithm)),delete r.algorithm),s[t]=r});let l=Object.assign(Object.assign({},v.Z),n);return Object.assign(Object.assign({},o),{theme:i,token:l,components:s,override:Object.assign({override:l},s),cssVar:a})},[eG]);return B&&(eH=s.createElement(E.Mj.Provider,{value:eW},eH)),e$.warning&&(eH=s.createElement(f.G8.Provider,{value:e$.warning},eH)),void 0!==G&&(eH=s.createElement(x.n,{disabled:G},eH)),s.createElement(S.E_.Provider,{value:e$},eH)},$=e=>{let t=s.useContext(S.E_),n=s.useContext(b.Z);return s.createElement(j,Object.assign({parentContext:t,legacyLocale:n},e))};$.ConfigContext=S.E_,$.SizeContext=C.Z,$.config=e=>{let{prefixCls:t,iconPrefixCls:n,theme:s,holderRender:l}=e;void 0!==t&&(r=t),void 0!==n&&(a=n),"holderRender"in e&&(i=l),s&&(Object.keys(s).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()},a=(e,t)=>{let a=new w.C(e),o=(0,T.R_)(a.toRgbString());n["".concat(t,"-color")]=r(a),n["".concat(t,"-color-disabled")]=o[1],n["".concat(t,"-color-hover")]=o[4],n["".concat(t,"-color-active")]=o[6],n["".concat(t,"-color-outline")]=a.clone().setAlpha(.2).toRgbString(),n["".concat(t,"-color-deprecated-bg")]=o[0],n["".concat(t,"-color-deprecated-border")]=o[2]};if(t.primaryColor){a(t.primaryColor,"primary");let e=new w.C(t.primaryColor),o=(0,T.R_)(e.toRgbString());o.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.setAlpha(.12*e.getAlpha()));let i=new w.C(o[0]);n["primary-color-active-deprecated-f-30"]=r(i,e=>e.setAlpha(.3*e.getAlpha())),n["primary-color-active-deprecated-d-02"]=r(i,e=>e.darken(2))}t.successColor&&a(t.successColor,"success"),t.warningColor&&a(t.warningColor,"warning"),t.errorColor&&a(t.errorColor,"error"),t.infoColor&&a(t.infoColor,"info");let o=Object.keys(n).map(t=>"--".concat(e,"-").concat(t,": ").concat(n[t],";"));return"\n :root {\n ".concat(o.join("\n"),"\n }\n ").trim()}(e,t);(0,A.Z)()&&(0,k.hq)(n,"".concat(R,"-dynamic-theme"))}(B(),s):o=s)},$.useConfig=function(){return{componentDisabled:(0,s.useContext)(x.Z),componentSize:(0,s.useContext)(C.Z)}},Object.defineProperty($,"SizeContext",{get:()=>C.Z});var z=$},47137:function(e,t,n){n.d(t,{RV:function(){return l},Rk:function(){return c},Ux:function(){return d},aM:function(){return u},pg:function(){return p},q3:function(){return i},qI:function(){return s}});var r=n(64090),a=n(76570),o=n(35704);let i=r.createContext({labelAlign:"right",vertical:!1,itemRef:()=>{}}),s=r.createContext(null),l=e=>{let t=(0,o.Z)(e,["prefixCls"]);return r.createElement(a.RV,Object.assign({},t))},c=r.createContext({prefixCls:""}),u=r.createContext({}),d=e=>{let{children:t,status:n,override:a}=e,o=(0,r.useContext)(u),i=(0,r.useMemo)(()=>{let e=Object.assign({},o);return a&&delete e.isFormItemInput,n&&(delete e.status,delete e.hasFeedback,delete e.feedbackIcon),e},[n,a,o]);return r.createElement(u.Provider,{value:i},t)},p=(0,r.createContext)(void 0)},12519:function(e,t,n){var r=n(64090);t.Z=(0,r.createContext)(void 0)},33302:function(e,t,n){let r=(0,n(64090).createContext)(void 0);t.Z=r},79474:function(e,t,n){n.d(t,{Z:function(){return i}});var r={placeholder:"Select time",rangePlaceholder:["Start time","End time"]};let a={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"]},{locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",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",yearFormat:"YYYY",dateFormat:"M/D/YYYY",dayFormat:"D",dateTimeFormat:"M/D/YYYY HH:mm:ss",monthBeforeYear:!0,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"}),timePickerLocale:Object.assign({},r)},o="${label} is not a valid ${type}";var i={locale:"en",Pagination:{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"},DatePicker:a,TimePicker:r,Calendar:a,global:{placeholder:"Please select"},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",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"},PageHeader:{back:"Back"},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:o,method:o,array:o,object:o,number:o,date:o,boolean:o,integer:o,float:o,regexp:o,email:o,url:o,hex:o},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"}}},70595:function(e,t,n){var r=n(64090),a=n(33302),o=n(79474);t.Z=(e,t)=>{let n=r.useContext(a.Z);return[r.useMemo(()=>{var r;let a=t||o.Z[e],i=null!==(r=null==n?void 0:n[e])&&void 0!==r?r:{};return Object.assign(Object.assign({},"function"==typeof a?a():a),i||{})},[e,t,n]),r.useMemo(()=>{let e=null==n?void 0:n.locale;return(null==n?void 0:n.exist)&&!e?o.Z.locale:e},[n])]}},80588:function(e,t,n){n.d(t,{ZP:function(){return eu}});var r=n(63787),a=n(64090),o=n(37274);let i=a.createContext({});var s=n(57499),l=n(54165),c=n(99537),u=n(77136),d=n(20653),p=n(40388),f=n(66155),g=n(16480),m=n.n(g),b=n(80406),h=n(60635),y=n(5239),E=n(89542),v=n(14749),S=n(50833),T=n(49367),w=n(4295),A=a.forwardRef(function(e,t){var n=e.prefixCls,r=e.style,o=e.className,i=e.duration,s=void 0===i?4.5:i,l=e.eventKey,c=e.content,u=e.closable,d=e.closeIcon,p=e.props,f=e.onClick,g=e.onNoticeClose,h=e.times,y=e.hovering,E=a.useState(!1),T=(0,b.Z)(E,2),A=T[0],k=T[1],R=y||A,x=function(){g(l)};a.useEffect(function(){if(!R&&s>0){var e=setTimeout(function(){x()},1e3*s);return function(){clearTimeout(e)}}},[s,R,h]);var C="".concat(n,"-notice");return a.createElement("div",(0,v.Z)({},p,{ref:t,className:m()(C,o,(0,S.Z)({},"".concat(C,"-closable"),u)),style:r,onMouseEnter:function(e){var t;k(!0),null==p||null===(t=p.onMouseEnter)||void 0===t||t.call(p,e)},onMouseLeave:function(e){var t;k(!1),null==p||null===(t=p.onMouseLeave)||void 0===t||t.call(p,e)},onClick:f}),a.createElement("div",{className:"".concat(C,"-content")},c),u&&a.createElement("a",{tabIndex:0,className:"".concat(C,"-close"),onKeyDown:function(e){("Enter"===e.key||"Enter"===e.code||e.keyCode===w.Z.ENTER)&&x()},onClick:function(e){e.preventDefault(),e.stopPropagation(),x()}},void 0===d?"x":d))}),k=a.createContext({}),R=function(e){var t=e.children,n=e.classNames;return a.createElement(k.Provider,{value:{classNames:n}},t)},x=n(6976),C=function(e){var t,n,r,a={offset:8,threshold:3,gap:16};return e&&"object"===(0,x.Z)(e)&&(a.offset=null!==(t=e.offset)&&void 0!==t?t:8,a.threshold=null!==(n=e.threshold)&&void 0!==n?n:3,a.gap=null!==(r=e.gap)&&void 0!==r?r:16),[!!e,a]},N=["className","style","classNames","styles"],I=function(e){var t,n=e.configList,o=e.placement,i=e.prefixCls,s=e.className,l=e.style,c=e.motion,u=e.onAllNoticeRemoved,d=e.onNoticeClose,p=e.stack,f=(0,a.useContext)(k).classNames,g=(0,a.useRef)({}),E=(0,a.useState)(null),w=(0,b.Z)(E,2),R=w[0],x=w[1],I=(0,a.useState)([]),_=(0,b.Z)(I,2),O=_[0],L=_[1],P=n.map(function(e){return{config:e,key:String(e.key)}}),D=C(p),M=(0,b.Z)(D,2),F=M[0],U=M[1],B=U.offset,G=U.threshold,Z=U.gap,j=F&&(O.length>0||P.length<=G),$="function"==typeof c?c(o):c;return(0,a.useEffect)(function(){F&&O.length>1&&L(function(e){return e.filter(function(e){return P.some(function(t){return e===t.key})})})},[O,P,F]),(0,a.useEffect)(function(){var e,t;F&&g.current[null===(e=P[P.length-1])||void 0===e?void 0:e.key]&&x(g.current[null===(t=P[P.length-1])||void 0===t?void 0:t.key])},[P,F]),a.createElement(T.V4,(0,v.Z)({key:o,className:m()(i,"".concat(i,"-").concat(o),null==f?void 0:f.list,s,(t={},(0,S.Z)(t,"".concat(i,"-stack"),!!F),(0,S.Z)(t,"".concat(i,"-stack-expanded"),j),t)),style:l,keys:P,motionAppear:!0},$,{onAllRemoved:function(){u(o)}}),function(e,t){var n=e.config,s=e.className,l=e.style,c=e.index,u=n.key,p=n.times,b=String(u),E=n.className,S=n.style,T=n.classNames,w=n.styles,k=(0,h.Z)(n,N),x=P.findIndex(function(e){return e.key===b}),C={};if(F){var I=P.length-1-(x>-1?x:c-1),_="top"===o||"bottom"===o?"-50%":"0";if(I>0){C.height=j?null===(D=g.current[b])||void 0===D?void 0:D.offsetHeight:null==R?void 0:R.offsetHeight;for(var D,M,U,G,$=0,z=0;z-1?g.current[b]=e:delete g.current[b]},prefixCls:i,classNames:T,styles:w,className:m()(E,null==f?void 0:f.notice),style:S,times:p,key:u,eventKey:u,onNoticeClose:d,hovering:F&&O.length>0})))})},_=a.forwardRef(function(e,t){var n=e.prefixCls,o=void 0===n?"rc-notification":n,i=e.container,s=e.motion,l=e.maxCount,c=e.className,u=e.style,d=e.onAllRemoved,p=e.stack,f=e.renderNotifications,g=a.useState([]),m=(0,b.Z)(g,2),h=m[0],v=m[1],S=function(e){var t,n=h.find(function(t){return t.key===e});null==n||null===(t=n.onClose)||void 0===t||t.call(n),v(function(t){return t.filter(function(t){return t.key!==e})})};a.useImperativeHandle(t,function(){return{open:function(e){v(function(t){var n,a=(0,r.Z)(t),o=a.findIndex(function(t){return t.key===e.key}),i=(0,y.Z)({},e);return o>=0?(i.times=((null===(n=t[o])||void 0===n?void 0:n.times)||0)+1,a[o]=i):(i.times=0,a.push(i)),l>0&&a.length>l&&(a=a.slice(-l)),a})},close:function(e){S(e)},destroy:function(){v([])}}});var T=a.useState({}),w=(0,b.Z)(T,2),A=w[0],k=w[1];a.useEffect(function(){var e={};h.forEach(function(t){var n=t.placement,r=void 0===n?"topRight":n;r&&(e[r]=e[r]||[],e[r].push(t))}),Object.keys(A).forEach(function(t){e[t]=e[t]||[]}),k(e)},[h]);var R=function(e){k(function(t){var n=(0,y.Z)({},t);return(n[e]||[]).length||delete n[e],n})},x=a.useRef(!1);if(a.useEffect(function(){Object.keys(A).length>0?x.current=!0:x.current&&(null==d||d(),x.current=!1)},[A]),!i)return null;var C=Object.keys(A);return(0,E.createPortal)(a.createElement(a.Fragment,null,C.map(function(e){var t=A[e],n=a.createElement(I,{key:e,configList:t,placement:e,prefixCls:o,className:null==c?void 0:c(e),style:null==u?void 0:u(e),motion:s,onNoticeClose:S,onAllNoticeRemoved:R,stack:p});return f?f(n,{prefixCls:o,key:e}):n})),i)}),O=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved","stack","renderNotifications"],L=function(){return document.body},P=0,D=n(8985),M=n(51761),F=n(11303),U=n(76585),B=n(80316);let G=e=>{let{componentCls:t,iconCls:n,boxShadow:r,colorText:a,colorSuccess:o,colorError:i,colorWarning:s,colorInfo:l,fontSizeLG:c,motionEaseInOutCirc:u,motionDurationSlow:d,marginXS:p,paddingXS:f,borderRadiusLG:g,zIndexPopup:m,contentPadding:b,contentBg:h}=e,y="".concat(t,"-notice"),E=new D.E4("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:f,transform:"translateY(0)",opacity:1}}),v=new D.E4("MessageMoveOut",{"0%":{maxHeight:e.height,padding:f,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}}),S={padding:f,textAlign:"center",["".concat(t,"-custom-content > ").concat(n)]:{verticalAlign:"text-bottom",marginInlineEnd:p,fontSize:c},["".concat(y,"-content")]:{display:"inline-block",padding:b,background:h,borderRadius:g,boxShadow:r,pointerEvents:"all"},["".concat(t,"-success > ").concat(n)]:{color:o},["".concat(t,"-error > ").concat(n)]:{color:i},["".concat(t,"-warning > ").concat(n)]:{color:s},["".concat(t,"-info > ").concat(n,",\n ").concat(t,"-loading > ").concat(n)]:{color:l}};return[{[t]:Object.assign(Object.assign({},(0,F.Wf)(e)),{color:a,position:"fixed",top:p,width:"100%",pointerEvents:"none",zIndex:m,["".concat(t,"-move-up")]:{animationFillMode:"forwards"},["\n ".concat(t,"-move-up-appear,\n ").concat(t,"-move-up-enter\n ")]:{animationName:E,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:v,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({},S)}},{["".concat(t,"-notice-pure-panel")]:Object.assign(Object.assign({},S),{padding:0,textAlign:"start"})}]};var Z=(0,U.I$)("Message",e=>[G((0,B.TS)(e,{height:150}))],e=>({zIndexPopup:e.zIndexPopupBase+M.u6+10,contentBg:e.colorBgElevated,contentPadding:"".concat((e.controlHeightLG-e.fontSize*e.lineHeight)/2,"px ").concat(e.paddingSM,"px")})),j=n(92935),$=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let z={info:a.createElement(p.Z,null),success:a.createElement(c.Z,null),error:a.createElement(u.Z,null),warning:a.createElement(d.Z,null),loading:a.createElement(f.Z,null)},H=e=>{let{prefixCls:t,type:n,icon:r,children:o}=e;return a.createElement("div",{className:m()("".concat(t,"-custom-content"),"".concat(t,"-").concat(n))},r||z[n],a.createElement("span",null,o))};var V=n(81303),W=n(76564);function q(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 Y=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let K=e=>{let{children:t,prefixCls:n}=e,r=(0,j.Z)(n),[o,i,s]=Z(n,r);return o(a.createElement(R,{classNames:{list:m()(i,s,r)}},t))},X=(e,t)=>{let{prefixCls:n,key:r}=t;return a.createElement(K,{prefixCls:n,key:r},e)},Q=a.forwardRef((e,t)=>{let{top:n,prefixCls:o,getContainer:i,maxCount:l,duration:c=3,rtl:u,transitionName:d,onAllRemoved:p}=e,{getPrefixCls:f,getPopupContainer:g,message:y,direction:E}=a.useContext(s.E_),v=o||f("message"),S=a.createElement("span",{className:"".concat(v,"-close-x")},a.createElement(V.Z,{className:"".concat(v,"-close-icon")})),[T,w]=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.getContainer,n=void 0===t?L:t,o=e.motion,i=e.prefixCls,s=e.maxCount,l=e.className,c=e.style,u=e.onAllRemoved,d=e.stack,p=e.renderNotifications,f=(0,h.Z)(e,O),g=a.useState(),m=(0,b.Z)(g,2),y=m[0],E=m[1],v=a.useRef(),S=a.createElement(_,{container:y,ref:v,prefixCls:i,motion:o,maxCount:s,className:l,style:c,onAllRemoved:u,stack:d,renderNotifications:p}),T=a.useState([]),w=(0,b.Z)(T,2),A=w[0],k=w[1],R=a.useMemo(function(){return{open:function(e){var t=function(){for(var e={},t=arguments.length,n=Array(t),r=0;r({left:"50%",transform:"translateX(-50%)",top:null!=n?n:8}),className:()=>m()({["".concat(v,"-rtl")]:null!=u?u:"rtl"===E}),motion:()=>({motionName:null!=d?d:"".concat(v,"-move-up")}),closable:!1,closeIcon:S,duration:c,getContainer:()=>(null==i?void 0:i())||(null==g?void 0:g())||document.body,maxCount:l,onAllRemoved:p,renderNotifications:X});return a.useImperativeHandle(t,()=>Object.assign(Object.assign({},T),{prefixCls:v,message:y})),w}),J=0;function ee(e){let t=a.useRef(null);return(0,W.ln)("Message"),[a.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:o,message:i}=t.current,s="".concat(o,"-notice"),{content:l,icon:c,type:u,key:d,className:p,style:f,onClose:g}=n,b=Y(n,["content","icon","type","key","className","style","onClose"]),h=d;return null==h&&(J+=1,h="antd-message-".concat(J)),q(t=>(r(Object.assign(Object.assign({},b),{key:h,content:a.createElement(H,{prefixCls:o,type:u,icon:c},l),placement:"top",className:m()(u&&"".concat(s,"-").concat(u),p,null==i?void 0:i.className),style:Object.assign(Object.assign({},null==i?void 0:i.style),f),onClose:()=>{null==g||g(),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,a)=>{let o,i;return"function"==typeof r?i=r:(o=r,i=a),n(Object.assign(Object.assign({onClose:i,duration:o},t&&"object"==typeof t&&"content"in t?t:{content:t}),{type:e}))}}),r},[]),a.createElement(Q,Object.assign({key:"message-holder"},e,{ref:t}))]}let et=null,en=e=>e(),er=[],ea={};function eo(){let{getContainer:e,duration:t,rtl:n,maxCount:r,top:a}=ea,o=(null==e?void 0:e())||document.body;return{getContainer:()=>o,duration:t,rtl:n,maxCount:r,top:a}}let ei=a.forwardRef((e,t)=>{let{messageConfig:n,sync:r}=e,{getPrefixCls:o}=(0,a.useContext)(s.E_),l=ea.prefixCls||o("message"),c=(0,a.useContext)(i),[u,d]=ee(Object.assign(Object.assign(Object.assign({},n),{prefixCls:l}),c.message));return a.useImperativeHandle(t,()=>{let e=Object.assign({},u);return Object.keys(e).forEach(t=>{e[t]=function(){return r(),u[t].apply(u,arguments)}}),{instance:e,sync:r}}),d}),es=a.forwardRef((e,t)=>{let[n,r]=a.useState(eo),o=()=>{r(eo)};a.useEffect(o,[]);let i=(0,l.w6)(),s=i.getRootPrefixCls(),c=i.getIconPrefixCls(),u=i.getTheme(),d=a.createElement(ei,{ref:t,sync:o,messageConfig:n});return a.createElement(l.ZP,{prefixCls:s,iconPrefixCls:c,theme:u},i.holderRender?i.holderRender(d):d)});function el(){if(!et){let e=document.createDocumentFragment(),t={fragment:e};et=t,en(()=>{(0,o.s)(a.createElement(es,{ref:e=>{let{instance:n,sync:r}=e||{};Promise.resolve().then(()=>{!t.instance&&n&&(t.instance=n,t.sync=r,el())})}}),e)});return}et.instance&&(er.forEach(e=>{let{type:t,skipped:n}=e;if(!n)switch(t){case"open":en(()=>{let t=et.instance.open(Object.assign(Object.assign({},ea),e.config));null==t||t.then(e.resolve),e.setCloseFn(t)});break;case"destroy":en(()=>{null==et||et.instance.destroy(e.key)});break;default:en(()=>{var n;let a=(n=et.instance)[t].apply(n,(0,r.Z)(e.args));null==a||a.then(e.resolve),e.setCloseFn(a)})}}),er=[])}let ec={open:function(e){let t=q(t=>{let n;let r={type:"open",config:e,resolve:t,setCloseFn:e=>{n=e}};return er.push(r),()=>{n?en(()=>{n()}):r.skipped=!0}});return el(),t},destroy:function(e){er.push({type:"destroy",key:e}),el()},config:function(e){ea=Object.assign(Object.assign({},ea),e),en(()=>{var e;null===(e=null==et?void 0:et.sync)||void 0===e||e.call(et)})},useMessage:function(e){return ee(e)},_InternalPanelDoNotUseOrYouWillBeFired:e=>{let{prefixCls:t,className:n,type:r,icon:o,content:i}=e,l=$(e,["prefixCls","className","type","icon","content"]),{getPrefixCls:c}=a.useContext(s.E_),u=t||c("message"),d=(0,j.Z)(u),[p,f,g]=Z(u,d);return p(a.createElement(A,Object.assign({},l,{prefixCls:u,className:m()(n,f,"".concat(u,"-notice-pure-panel"),g,d),eventKey:"pure",duration:null,content:a.createElement(H,{prefixCls:u,type:r,icon:o},i)})))}};["success","info","warning","error","loading"].forEach(e=>{ec[e]=function(){for(var t=arguments.length,n=Array(t),r=0;r{let r;let a={type:e,args:t,resolve:n,setCloseFn:e=>{r=e}};return er.push(a),()=>{r?en(()=>{r()}):a.skipped=!0}});return el(),n}(e,n)}});var eu=ec},99129:function(e,t,n){let r;n.d(t,{Z:function(){return eq}});var a=n(63787),o=n(64090),i=n(37274),s=n(57499),l=n(54165),c=n(99537),u=n(77136),d=n(20653),p=n(40388),f=n(16480),g=n.n(f),m=n(51761),b=n(47387),h=n(70595),y=n(24750),E=n(89211),v=n(1861),S=n(51350),T=e=>{let{type:t,children:n,prefixCls:r,buttonProps:a,close:i,autoFocus:s,emitEvent:l,isSilent:c,quitOnNullishReturnValue:u,actionFn:d}=e,p=o.useRef(!1),f=o.useRef(null),[g,m]=(0,E.Z)(!1),b=function(){null==i||i.apply(void 0,arguments)};o.useEffect(()=>{let e=null;return s&&(e=setTimeout(()=>{var e;null===(e=f.current)||void 0===e||e.focus()})),()=>{e&&clearTimeout(e)}},[]);let h=e=>{e&&e.then&&(m(!0),e.then(function(){m(!1,!0),b.apply(void 0,arguments),p.current=!1},e=>{if(m(!1,!0),p.current=!1,null==c||!c())return Promise.reject(e)}))};return o.createElement(v.ZP,Object.assign({},(0,S.nx)(t),{onClick:e=>{let t;if(!p.current){if(p.current=!0,!d){b();return}if(l){var n;if(t=d(e),u&&!((n=t)&&n.then)){p.current=!1,b(e);return}}else if(d.length)t=d(i),p.current=!1;else if(!(t=d())){b();return}h(t)}},loading:g,prefixCls:r},a,{ref:f}),n)};let w=o.createContext({}),{Provider:A}=w;var k=()=>{let{autoFocusButton:e,cancelButtonProps:t,cancelTextLocale:n,isSilent:r,mergedOkCancel:a,rootPrefixCls:i,close:s,onCancel:l,onConfirm:c}=(0,o.useContext)(w);return a?o.createElement(T,{isSilent:r,actionFn:l,close:function(){null==s||s.apply(void 0,arguments),null==c||c(!1)},autoFocus:"cancel"===e,buttonProps:t,prefixCls:"".concat(i,"-btn")},n):null},R=()=>{let{autoFocusButton:e,close:t,isSilent:n,okButtonProps:r,rootPrefixCls:a,okTextLocale:i,okType:s,onConfirm:l,onOk:c}=(0,o.useContext)(w);return o.createElement(T,{isSilent:n,type:s||"primary",actionFn:c,close:function(){null==t||t.apply(void 0,arguments),null==l||l(!0)},autoFocus:"ok"===e,buttonProps:r,prefixCls:"".concat(a,"-btn")},i)},x=n(81303),C=n(14749),N=n(80406),I=n(88804),_=o.createContext({}),O=n(5239),L=n(31506),P=n(91010),D=n(4295),M=n(72480);function F(e,t,n){var r=t;return!r&&n&&(r="".concat(e,"-").concat(n)),r}function U(e,t){var n=e["page".concat(t?"Y":"X","Offset")],r="scroll".concat(t?"Top":"Left");if("number"!=typeof n){var a=e.document;"number"!=typeof(n=a.documentElement[r])&&(n=a.body[r])}return n}var B=n(49367),G=n(74084),Z=o.memo(function(e){return e.children},function(e,t){return!t.shouldUpdate}),j={width:0,height:0,overflow:"hidden",outline:"none"},$=o.forwardRef(function(e,t){var n,r,a,i=e.prefixCls,s=e.className,l=e.style,c=e.title,u=e.ariaId,d=e.footer,p=e.closable,f=e.closeIcon,m=e.onClose,b=e.children,h=e.bodyStyle,y=e.bodyProps,E=e.modalRender,v=e.onMouseDown,S=e.onMouseUp,T=e.holderRef,w=e.visible,A=e.forceRender,k=e.width,R=e.height,x=e.classNames,N=e.styles,I=o.useContext(_).panel,L=(0,G.x1)(T,I),P=(0,o.useRef)(),D=(0,o.useRef)();o.useImperativeHandle(t,function(){return{focus:function(){var e;null===(e=P.current)||void 0===e||e.focus()},changeActive:function(e){var t=document.activeElement;e&&t===D.current?P.current.focus():e||t!==P.current||D.current.focus()}}});var M={};void 0!==k&&(M.width=k),void 0!==R&&(M.height=R),d&&(n=o.createElement("div",{className:g()("".concat(i,"-footer"),null==x?void 0:x.footer),style:(0,O.Z)({},null==N?void 0:N.footer)},d)),c&&(r=o.createElement("div",{className:g()("".concat(i,"-header"),null==x?void 0:x.header),style:(0,O.Z)({},null==N?void 0:N.header)},o.createElement("div",{className:"".concat(i,"-title"),id:u},c))),p&&(a=o.createElement("button",{type:"button",onClick:m,"aria-label":"Close",className:"".concat(i,"-close")},f||o.createElement("span",{className:"".concat(i,"-close-x")})));var F=o.createElement("div",{className:g()("".concat(i,"-content"),null==x?void 0:x.content),style:null==N?void 0:N.content},a,r,o.createElement("div",(0,C.Z)({className:g()("".concat(i,"-body"),null==x?void 0:x.body),style:(0,O.Z)((0,O.Z)({},h),null==N?void 0:N.body)},y),b),n);return o.createElement("div",{key:"dialog-element",role:"dialog","aria-labelledby":c?u:null,"aria-modal":"true",ref:L,style:(0,O.Z)((0,O.Z)({},l),M),className:g()(i,s),onMouseDown:v,onMouseUp:S},o.createElement("div",{tabIndex:0,ref:P,style:j,"aria-hidden":"true"}),o.createElement(Z,{shouldUpdate:w||A},E?E(F):F),o.createElement("div",{tabIndex:0,ref:D,style:j,"aria-hidden":"true"}))}),z=o.forwardRef(function(e,t){var n=e.prefixCls,r=e.title,a=e.style,i=e.className,s=e.visible,l=e.forceRender,c=e.destroyOnClose,u=e.motionName,d=e.ariaId,p=e.onVisibleChanged,f=e.mousePosition,m=(0,o.useRef)(),b=o.useState(),h=(0,N.Z)(b,2),y=h[0],E=h[1],v={};function S(){var e,t,n,r,a,o=(n={left:(t=(e=m.current).getBoundingClientRect()).left,top:t.top},a=(r=e.ownerDocument).defaultView||r.parentWindow,n.left+=U(a),n.top+=U(a,!0),n);E(f?"".concat(f.x-o.left,"px ").concat(f.y-o.top,"px"):"")}return y&&(v.transformOrigin=y),o.createElement(B.ZP,{visible:s,onVisibleChanged:p,onAppearPrepare:S,onEnterPrepare:S,forceRender:l,motionName:u,removeOnLeave:c,ref:m},function(s,l){var c=s.className,u=s.style;return o.createElement($,(0,C.Z)({},e,{ref:t,title:r,ariaId:d,prefixCls:n,holderRef:l,style:(0,O.Z)((0,O.Z)((0,O.Z)({},u),a),v),className:g()(i,c)}))})});function H(e){var t=e.prefixCls,n=e.style,r=e.visible,a=e.maskProps,i=e.motionName,s=e.className;return o.createElement(B.ZP,{key:"mask",visible:r,motionName:i,leavedClassName:"".concat(t,"-mask-hidden")},function(e,r){var i=e.className,l=e.style;return o.createElement("div",(0,C.Z)({ref:r,style:(0,O.Z)((0,O.Z)({},l),n),className:g()("".concat(t,"-mask"),i,s)},a))})}function V(e){var t=e.prefixCls,n=void 0===t?"rc-dialog":t,r=e.zIndex,a=e.visible,i=void 0!==a&&a,s=e.keyboard,l=void 0===s||s,c=e.focusTriggerAfterClose,u=void 0===c||c,d=e.wrapStyle,p=e.wrapClassName,f=e.wrapProps,m=e.onClose,b=e.afterOpenChange,h=e.afterClose,y=e.transitionName,E=e.animation,v=e.closable,S=e.mask,T=void 0===S||S,w=e.maskTransitionName,A=e.maskAnimation,k=e.maskClosable,R=e.maskStyle,x=e.maskProps,I=e.rootClassName,_=e.classNames,U=e.styles,B=(0,o.useRef)(),G=(0,o.useRef)(),Z=(0,o.useRef)(),j=o.useState(i),$=(0,N.Z)(j,2),V=$[0],W=$[1],q=(0,P.Z)();function Y(e){null==m||m(e)}var K=(0,o.useRef)(!1),X=(0,o.useRef)(),Q=null;return(void 0===k||k)&&(Q=function(e){K.current?K.current=!1:G.current===e.target&&Y(e)}),(0,o.useEffect)(function(){i&&(W(!0),(0,L.Z)(G.current,document.activeElement)||(B.current=document.activeElement))},[i]),(0,o.useEffect)(function(){return function(){clearTimeout(X.current)}},[]),o.createElement("div",(0,C.Z)({className:g()("".concat(n,"-root"),I)},(0,M.Z)(e,{data:!0})),o.createElement(H,{prefixCls:n,visible:T&&i,motionName:F(n,w,A),style:(0,O.Z)((0,O.Z)({zIndex:r},R),null==U?void 0:U.mask),maskProps:x,className:null==_?void 0:_.mask}),o.createElement("div",(0,C.Z)({tabIndex:-1,onKeyDown:function(e){if(l&&e.keyCode===D.Z.ESC){e.stopPropagation(),Y(e);return}i&&e.keyCode===D.Z.TAB&&Z.current.changeActive(!e.shiftKey)},className:g()("".concat(n,"-wrap"),p,null==_?void 0:_.wrapper),ref:G,onClick:Q,style:(0,O.Z)((0,O.Z)((0,O.Z)({zIndex:r},d),null==U?void 0:U.wrapper),{},{display:V?null:"none"})},f),o.createElement(z,(0,C.Z)({},e,{onMouseDown:function(){clearTimeout(X.current),K.current=!0},onMouseUp:function(){X.current=setTimeout(function(){K.current=!1})},ref:Z,closable:void 0===v||v,ariaId:q,prefixCls:n,visible:i&&V,onClose:Y,onVisibleChanged:function(e){if(e)!function(){if(!(0,L.Z)(G.current,document.activeElement)){var e;null===(e=Z.current)||void 0===e||e.focus()}}();else{if(W(!1),T&&B.current&&u){try{B.current.focus({preventScroll:!0})}catch(e){}B.current=null}V&&(null==h||h())}null==b||b(e)},motionName:F(n,y,E)}))))}z.displayName="Content",n(53850);var W=function(e){var t=e.visible,n=e.getContainer,r=e.forceRender,a=e.destroyOnClose,i=void 0!==a&&a,s=e.afterClose,l=e.panelRef,c=o.useState(t),u=(0,N.Z)(c,2),d=u[0],p=u[1],f=o.useMemo(function(){return{panel:l}},[l]);return(o.useEffect(function(){t&&p(!0)},[t]),r||!i||d)?o.createElement(_.Provider,{value:f},o.createElement(I.Z,{open:t||r||d,autoDestroy:!1,getContainer:n,autoLock:t||d},o.createElement(V,(0,C.Z)({},e,{destroyOnClose:i,afterClose:function(){null==s||s(),p(!1)}})))):null};W.displayName="Dialog";var q=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:o.createElement(x.Z,null),a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if("boolean"==typeof e?!e:void 0===t?!a:!1===t||null===t)return[!1,null];let i="boolean"==typeof t||null==t?r:t;return[!0,n?n(i):i]},Y=n(22127),K=n(86718),X=n(47137),Q=n(92801),J=n(48563);function ee(){}let et=o.createContext({add:ee,remove:ee});var en=n(17094),er=()=>{let{cancelButtonProps:e,cancelTextLocale:t,onCancel:n}=(0,o.useContext)(w);return o.createElement(v.ZP,Object.assign({onClick:n},e),t)},ea=()=>{let{confirmLoading:e,okButtonProps:t,okType:n,okTextLocale:r,onOk:a}=(0,o.useContext)(w);return o.createElement(v.ZP,Object.assign({},(0,S.nx)(n),{loading:e,onClick:a},t),r)},eo=n(4678);function ei(e,t){return o.createElement("span",{className:"".concat(e,"-close-x")},t||o.createElement(x.Z,{className:"".concat(e,"-close-icon")}))}let es=e=>{let t;let{okText:n,okType:r="primary",cancelText:i,confirmLoading:s,onOk:l,onCancel:c,okButtonProps:u,cancelButtonProps:d,footer:p}=e,[f]=(0,h.Z)("Modal",(0,eo.A)()),g={confirmLoading:s,okButtonProps:u,cancelButtonProps:d,okTextLocale:n||(null==f?void 0:f.okText),cancelTextLocale:i||(null==f?void 0:f.cancelText),okType:r,onOk:l,onCancel:c},m=o.useMemo(()=>g,(0,a.Z)(Object.values(g)));return"function"==typeof p||void 0===p?(t=o.createElement(o.Fragment,null,o.createElement(er,null),o.createElement(ea,null)),"function"==typeof p&&(t=p(t,{OkBtn:ea,CancelBtn:er})),t=o.createElement(A,{value:m},t)):t=p,o.createElement(en.n,{disabled:!1},t)};var el=n(11303),ec=n(13703),eu=n(58854),ed=n(80316),ep=n(76585),ef=n(8985);function eg(e){return{position:e,inset:0}}let em=e=>{let{componentCls:t,antCls:n}=e;return[{["".concat(t,"-root")]:{["".concat(t).concat(n,"-zoom-enter, ").concat(t).concat(n,"-zoom-appear")]:{transform:"none",opacity:0,animationDuration:e.motionDurationSlow,userSelect:"none"},["".concat(t).concat(n,"-zoom-leave ").concat(t,"-content")]:{pointerEvents:"none"},["".concat(t,"-mask")]:Object.assign(Object.assign({},eg("fixed")),{zIndex:e.zIndexPopupBase,height:"100%",backgroundColor:e.colorBgMask,pointerEvents:"none",["".concat(t,"-hidden")]:{display:"none"}}),["".concat(t,"-wrap")]:Object.assign(Object.assign({},eg("fixed")),{zIndex:e.zIndexPopupBase,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch",["&:has(".concat(t).concat(n,"-zoom-enter), &:has(").concat(t).concat(n,"-zoom-appear)")]:{pointerEvents:"none"}})}},{["".concat(t,"-root")]:(0,ec.J$)(e)}]},eb=e=>{let{componentCls:t}=e;return[{["".concat(t,"-root")]:{["".concat(t,"-wrap-rtl")]:{direction:"rtl"},["".concat(t,"-centered")]:{textAlign:"center","&::before":{display:"inline-block",width:0,height:"100%",verticalAlign:"middle",content:'""'},[t]:{top:0,display:"inline-block",paddingBottom:0,textAlign:"start",verticalAlign:"middle"}},["@media (max-width: ".concat(e.screenSMMax,"px)")]:{[t]:{maxWidth:"calc(100vw - 16px)",margin:"".concat((0,ef.bf)(e.marginXS)," auto")},["".concat(t,"-centered")]:{[t]:{flex:1}}}}},{[t]:Object.assign(Object.assign({},(0,el.Wf)(e)),{pointerEvents:"none",position:"relative",top:100,width:"auto",maxWidth:"calc(100vw - ".concat((0,ef.bf)(e.calc(e.margin).mul(2).equal()),")"),margin:"0 auto",paddingBottom:e.paddingLG,["".concat(t,"-title")]:{margin:0,color:e.titleColor,fontWeight:e.fontWeightStrong,fontSize:e.titleFontSize,lineHeight:e.titleLineHeight,wordWrap:"break-word"},["".concat(t,"-content")]:{position:"relative",backgroundColor:e.contentBg,backgroundClip:"padding-box",border:0,borderRadius:e.borderRadiusLG,boxShadow:e.boxShadow,pointerEvents:"auto",padding:e.contentPadding},["".concat(t,"-close")]:Object.assign({position:"absolute",top:e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),insetInlineEnd:e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),zIndex:e.calc(e.zIndexPopupBase).add(10).equal(),padding:0,color:e.modalCloseIconColor,fontWeight:e.fontWeightStrong,lineHeight:1,textDecoration:"none",background:"transparent",borderRadius:e.borderRadiusSM,width:e.modalCloseBtnSize,height:e.modalCloseBtnSize,border:0,outline:0,cursor:"pointer",transition:"color ".concat(e.motionDurationMid,", background-color ").concat(e.motionDurationMid),"&-x":{display:"flex",fontSize:e.fontSizeLG,fontStyle:"normal",lineHeight:"".concat((0,ef.bf)(e.modalCloseBtnSize)),justifyContent:"center",textTransform:"none",textRendering:"auto"},"&:hover":{color:e.modalIconHoverColor,backgroundColor:e.closeBtnHoverBg,textDecoration:"none"},"&:active":{backgroundColor:e.closeBtnActiveBg}},(0,el.Qy)(e)),["".concat(t,"-header")]:{color:e.colorText,background:e.headerBg,borderRadius:"".concat((0,ef.bf)(e.borderRadiusLG)," ").concat((0,ef.bf)(e.borderRadiusLG)," 0 0"),marginBottom:e.headerMarginBottom,padding:e.headerPadding,borderBottom:e.headerBorderBottom},["".concat(t,"-body")]:{fontSize:e.fontSize,lineHeight:e.lineHeight,wordWrap:"break-word",padding:e.bodyPadding},["".concat(t,"-footer")]:{textAlign:"end",background:e.footerBg,marginTop:e.footerMarginTop,padding:e.footerPadding,borderTop:e.footerBorderTop,borderRadius:e.footerBorderRadius,["> ".concat(e.antCls,"-btn + ").concat(e.antCls,"-btn")]:{marginInlineStart:e.marginXS}},["".concat(t,"-open")]:{overflow:"hidden"}})},{["".concat(t,"-pure-panel")]:{top:"auto",padding:0,display:"flex",flexDirection:"column",["".concat(t,"-content,\n ").concat(t,"-body,\n ").concat(t,"-confirm-body-wrapper")]:{display:"flex",flexDirection:"column",flex:"auto"},["".concat(t,"-confirm-body")]:{marginBottom:"auto"}}}]},eh=e=>{let{componentCls:t}=e;return{["".concat(t,"-root")]:{["".concat(t,"-wrap-rtl")]:{direction:"rtl",["".concat(t,"-confirm-body")]:{direction:"rtl"}}}}},ey=e=>{let t=e.padding,n=e.fontSizeHeading5,r=e.lineHeightHeading5;return(0,ed.TS)(e,{modalHeaderHeight:e.calc(e.calc(r).mul(n).equal()).add(e.calc(t).mul(2).equal()).equal(),modalFooterBorderColorSplit:e.colorSplit,modalFooterBorderStyle:e.lineType,modalFooterBorderWidth:e.lineWidth,modalIconHoverColor:e.colorIconHover,modalCloseIconColor:e.colorIcon,modalCloseBtnSize:e.fontHeight,modalConfirmIconSize:e.fontHeight,modalTitleHeight:e.calc(e.titleFontSize).mul(e.titleLineHeight).equal()})},eE=e=>({footerBg:"transparent",headerBg:e.colorBgElevated,titleLineHeight:e.lineHeightHeading5,titleFontSize:e.fontSizeHeading5,contentBg:e.colorBgElevated,titleColor:e.colorTextHeading,closeBtnHoverBg:e.wireframe?"transparent":e.colorFillContent,closeBtnActiveBg:e.wireframe?"transparent":e.colorFillContentHover,contentPadding:e.wireframe?0:"".concat((0,ef.bf)(e.paddingMD)," ").concat((0,ef.bf)(e.paddingContentHorizontalLG)),headerPadding:e.wireframe?"".concat((0,ef.bf)(e.padding)," ").concat((0,ef.bf)(e.paddingLG)):0,headerBorderBottom:e.wireframe?"".concat((0,ef.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit):"none",headerMarginBottom:e.wireframe?0:e.marginXS,bodyPadding:e.wireframe?e.paddingLG:0,footerPadding:e.wireframe?"".concat((0,ef.bf)(e.paddingXS)," ").concat((0,ef.bf)(e.padding)):0,footerBorderTop:e.wireframe?"".concat((0,ef.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit):"none",footerBorderRadius:e.wireframe?"0 0 ".concat((0,ef.bf)(e.borderRadiusLG)," ").concat((0,ef.bf)(e.borderRadiusLG)):0,footerMarginTop:e.wireframe?0:e.marginSM,confirmBodyPadding:e.wireframe?"".concat((0,ef.bf)(2*e.padding)," ").concat((0,ef.bf)(2*e.padding)," ").concat((0,ef.bf)(e.paddingLG)):0,confirmIconMarginInlineEnd:e.wireframe?e.margin:e.marginSM,confirmBtnsMarginTop:e.wireframe?e.marginLG:e.marginSM});var ev=(0,ep.I$)("Modal",e=>{let t=ey(e);return[eb(t),eh(t),em(t),(0,eu._y)(t,"zoom")]},eE,{unitless:{titleLineHeight:!0}}),eS=n(92935),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};(0,Y.Z)()&&window.document.documentElement&&document.documentElement.addEventListener("click",e=>{r={x:e.pageX,y:e.pageY},setTimeout(()=>{r=null},100)},!0);var ew=e=>{var t;let{getPopupContainer:n,getPrefixCls:a,direction:i,modal:l}=o.useContext(s.E_),c=t=>{let{onCancel:n}=e;null==n||n(t)},{prefixCls:u,className:d,rootClassName:p,open:f,wrapClassName:h,centered:y,getContainer:E,closeIcon:v,closable:S,focusTriggerAfterClose:T=!0,style:w,visible:A,width:k=520,footer:R,classNames:C,styles:N}=e,I=eT(e,["prefixCls","className","rootClassName","open","wrapClassName","centered","getContainer","closeIcon","closable","focusTriggerAfterClose","style","visible","width","footer","classNames","styles"]),_=a("modal",u),O=a(),L=(0,eS.Z)(_),[P,D,M]=ev(_,L),F=g()(h,{["".concat(_,"-centered")]:!!y,["".concat(_,"-wrap-rtl")]:"rtl"===i}),U=null!==R&&o.createElement(es,Object.assign({},e,{onOk:t=>{let{onOk:n}=e;null==n||n(t)},onCancel:c})),[B,G]=q(S,v,e=>ei(_,e),o.createElement(x.Z,{className:"".concat(_,"-close-icon")}),!0),Z=function(e){let t=o.useContext(et),n=o.useRef();return(0,J.zX)(r=>{if(r){let a=e?r.querySelector(e):r;t.add(a),n.current=a}else t.remove(n.current)})}(".".concat(_,"-content")),[j,$]=(0,m.Cn)("Modal",I.zIndex);return P(o.createElement(Q.BR,null,o.createElement(X.Ux,{status:!0,override:!0},o.createElement(K.Z.Provider,{value:$},o.createElement(W,Object.assign({width:k},I,{zIndex:j,getContainer:void 0===E?n:E,prefixCls:_,rootClassName:g()(D,p,M,L),footer:U,visible:null!=f?f:A,mousePosition:null!==(t=I.mousePosition)&&void 0!==t?t:r,onClose:c,closable:B,closeIcon:G,focusTriggerAfterClose:T,transitionName:(0,b.m)(O,"zoom",e.transitionName),maskTransitionName:(0,b.m)(O,"fade",e.maskTransitionName),className:g()(D,d,null==l?void 0:l.className),style:Object.assign(Object.assign({},null==l?void 0:l.style),w),classNames:Object.assign(Object.assign({wrapper:F},null==l?void 0:l.classNames),C),styles:Object.assign(Object.assign({},null==l?void 0:l.styles),N),panelRef:Z}))))))};let eA=e=>{let{componentCls:t,titleFontSize:n,titleLineHeight:r,modalConfirmIconSize:a,fontSize:o,lineHeight:i,modalTitleHeight:s,fontHeight:l,confirmBodyPadding:c}=e,u="".concat(t,"-confirm");return{[u]:{"&-rtl":{direction:"rtl"},["".concat(e.antCls,"-modal-header")]:{display:"none"},["".concat(u,"-body-wrapper")]:Object.assign({},(0,el.dF)()),["&".concat(t," ").concat(t,"-body")]:{padding:c},["".concat(u,"-body")]:{display:"flex",flexWrap:"nowrap",alignItems:"start",["> ".concat(e.iconCls)]:{flex:"none",fontSize:a,marginInlineEnd:e.confirmIconMarginInlineEnd,marginTop:e.calc(e.calc(l).sub(a).equal()).div(2).equal()},["&-has-title > ".concat(e.iconCls)]:{marginTop:e.calc(e.calc(s).sub(a).equal()).div(2).equal()}},["".concat(u,"-paragraph")]:{display:"flex",flexDirection:"column",flex:"auto",rowGap:e.marginXS,maxWidth:"calc(100% - ".concat((0,ef.bf)(e.calc(e.modalConfirmIconSize).add(e.marginSM).equal()),")")},["".concat(u,"-title")]:{color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:n,lineHeight:r},["".concat(u,"-content")]:{color:e.colorText,fontSize:o,lineHeight:i},["".concat(u,"-btns")]:{textAlign:"end",marginTop:e.confirmBtnsMarginTop,["".concat(e.antCls,"-btn + ").concat(e.antCls,"-btn")]:{marginBottom:0,marginInlineStart:e.marginXS}}},["".concat(u,"-error ").concat(u,"-body > ").concat(e.iconCls)]:{color:e.colorError},["".concat(u,"-warning ").concat(u,"-body > ").concat(e.iconCls,",\n ").concat(u,"-confirm ").concat(u,"-body > ").concat(e.iconCls)]:{color:e.colorWarning},["".concat(u,"-info ").concat(u,"-body > ").concat(e.iconCls)]:{color:e.colorInfo},["".concat(u,"-success ").concat(u,"-body > ").concat(e.iconCls)]:{color:e.colorSuccess}}};var ek=(0,ep.bk)(["Modal","confirm"],e=>[eA(ey(e))],eE,{order:-1e3}),eR=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};function ex(e){let{prefixCls:t,icon:n,okText:r,cancelText:i,confirmPrefixCls:s,type:l,okCancel:f,footer:m,locale:b}=e,y=eR(e,["prefixCls","icon","okText","cancelText","confirmPrefixCls","type","okCancel","footer","locale"]),E=n;if(!n&&null!==n)switch(l){case"info":E=o.createElement(p.Z,null);break;case"success":E=o.createElement(c.Z,null);break;case"error":E=o.createElement(u.Z,null);break;default:E=o.createElement(d.Z,null)}let v=null!=f?f:"confirm"===l,S=null!==e.autoFocusButton&&(e.autoFocusButton||"ok"),[T]=(0,h.Z)("Modal"),w=b||T,x=r||(v?null==w?void 0:w.okText:null==w?void 0:w.justOkText),C=Object.assign({autoFocusButton:S,cancelTextLocale:i||(null==w?void 0:w.cancelText),okTextLocale:x,mergedOkCancel:v},y),N=o.useMemo(()=>C,(0,a.Z)(Object.values(C))),I=o.createElement(o.Fragment,null,o.createElement(k,null),o.createElement(R,null)),_=void 0!==e.title&&null!==e.title,O="".concat(s,"-body");return o.createElement("div",{className:"".concat(s,"-body-wrapper")},o.createElement("div",{className:g()(O,{["".concat(O,"-has-title")]:_})},E,o.createElement("div",{className:"".concat(s,"-paragraph")},_&&o.createElement("span",{className:"".concat(s,"-title")},e.title),o.createElement("div",{className:"".concat(s,"-content")},e.content))),void 0===m||"function"==typeof m?o.createElement(A,{value:N},o.createElement("div",{className:"".concat(s,"-btns")},"function"==typeof m?m(I,{OkBtn:R,CancelBtn:k}):I)):m,o.createElement(ek,{prefixCls:t}))}let eC=e=>{let{close:t,zIndex:n,afterClose:r,open:a,keyboard:i,centered:s,getContainer:l,maskStyle:c,direction:u,prefixCls:d,wrapClassName:p,rootPrefixCls:f,bodyStyle:h,closable:E=!1,closeIcon:v,modalRender:S,focusTriggerAfterClose:T,onConfirm:w,styles:A}=e,k="".concat(d,"-confirm"),R=e.width||416,x=e.style||{},C=void 0===e.mask||e.mask,N=void 0!==e.maskClosable&&e.maskClosable,I=g()(k,"".concat(k,"-").concat(e.type),{["".concat(k,"-rtl")]:"rtl"===u},e.className),[,_]=(0,y.ZP)(),O=o.useMemo(()=>void 0!==n?n:_.zIndexPopupBase+m.u6,[n,_]);return o.createElement(ew,{prefixCls:d,className:I,wrapClassName:g()({["".concat(k,"-centered")]:!!e.centered},p),onCancel:()=>{null==t||t({triggerCancel:!0}),null==w||w(!1)},open:a,title:"",footer:null,transitionName:(0,b.m)(f||"","zoom",e.transitionName),maskTransitionName:(0,b.m)(f||"","fade",e.maskTransitionName),mask:C,maskClosable:N,style:x,styles:Object.assign({body:h,mask:c},A),width:R,zIndex:O,afterClose:r,keyboard:i,centered:s,getContainer:l,closable:E,closeIcon:v,modalRender:S,focusTriggerAfterClose:T},o.createElement(ex,Object.assign({},e,{confirmPrefixCls:k})))};var eN=e=>{let{rootPrefixCls:t,iconPrefixCls:n,direction:r,theme:a}=e;return o.createElement(l.ZP,{prefixCls:t,iconPrefixCls:n,direction:r,theme:a},o.createElement(eC,Object.assign({},e)))},eI=[];let e_="",eO=e=>{var t,n;let{prefixCls:r,getContainer:a,direction:i}=e,l=(0,eo.A)(),c=(0,o.useContext)(s.E_),u=e_||c.getPrefixCls(),d=r||"".concat(u,"-modal"),p=a;return!1===p&&(p=void 0),o.createElement(eN,Object.assign({},e,{rootPrefixCls:u,prefixCls:d,iconPrefixCls:c.iconPrefixCls,theme:c.theme,direction:null!=i?i:c.direction,locale:null!==(n=null===(t=c.locale)||void 0===t?void 0:t.Modal)&&void 0!==n?n:l,getContainer:p}))};function eL(e){let t;let n=(0,l.w6)(),r=document.createDocumentFragment(),s=Object.assign(Object.assign({},e),{close:d,open:!0});function c(){for(var t=arguments.length,n=Array(t),o=0;oe&&e.triggerCancel);e.onCancel&&s&&e.onCancel.apply(e,[()=>{}].concat((0,a.Z)(n.slice(1))));for(let e=0;e{let t=n.getPrefixCls(void 0,e_),a=n.getIconPrefixCls(),s=n.getTheme(),c=o.createElement(eO,Object.assign({},e));(0,i.s)(o.createElement(l.ZP,{prefixCls:t,iconPrefixCls:a,theme:s},n.holderRender?n.holderRender(c):c),r)})}function d(){for(var t=arguments.length,n=Array(t),r=0;r{"function"==typeof e.afterClose&&e.afterClose(),c.apply(this,n)}})).visible&&delete s.visible,u(s)}return u(s),eI.push(d),{destroy:d,update:function(e){u(s="function"==typeof e?e(s):Object.assign(Object.assign({},s),e))}}}function eP(e){return Object.assign(Object.assign({},e),{type:"warning"})}function eD(e){return Object.assign(Object.assign({},e),{type:"info"})}function eM(e){return Object.assign(Object.assign({},e),{type:"success"})}function eF(e){return Object.assign(Object.assign({},e),{type:"error"})}function eU(e){return Object.assign(Object.assign({},e),{type:"confirm"})}var eB=n(21467),eG=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},eZ=(0,eB.i)(e=>{let{prefixCls:t,className:n,closeIcon:r,closable:a,type:i,title:l,children:c,footer:u}=e,d=eG(e,["prefixCls","className","closeIcon","closable","type","title","children","footer"]),{getPrefixCls:p}=o.useContext(s.E_),f=p(),m=t||p("modal"),b=(0,eS.Z)(f),[h,y,E]=ev(m,b),v="".concat(m,"-confirm"),S={};return S=i?{closable:null!=a&&a,title:"",footer:"",children:o.createElement(ex,Object.assign({},e,{prefixCls:m,confirmPrefixCls:v,rootPrefixCls:f,content:c}))}:{closable:null==a||a,title:l,footer:null!==u&&o.createElement(es,Object.assign({},e)),children:c},h(o.createElement($,Object.assign({prefixCls:m,className:g()(y,"".concat(m,"-pure-panel"),i&&v,i&&"".concat(v,"-").concat(i),n,E,b)},d,{closeIcon:ei(m,r),closable:a},S)))}),ej=n(79474),e$=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},ez=o.forwardRef((e,t)=>{var n,{afterClose:r,config:i}=e,l=e$(e,["afterClose","config"]);let[c,u]=o.useState(!0),[d,p]=o.useState(i),{direction:f,getPrefixCls:g}=o.useContext(s.E_),m=g("modal"),b=g(),y=function(){u(!1);for(var e=arguments.length,t=Array(e),n=0;ne&&e.triggerCancel);d.onCancel&&r&&d.onCancel.apply(d,[()=>{}].concat((0,a.Z)(t.slice(1))))};o.useImperativeHandle(t,()=>({destroy:y,update:e=>{p(t=>Object.assign(Object.assign({},t),e))}}));let E=null!==(n=d.okCancel)&&void 0!==n?n:"confirm"===d.type,[v]=(0,h.Z)("Modal",ej.Z.Modal);return o.createElement(eN,Object.assign({prefixCls:m,rootPrefixCls:b},d,{close:y,open:c,afterClose:()=>{var e;r(),null===(e=d.afterClose)||void 0===e||e.call(d)},okText:d.okText||(E?null==v?void 0:v.okText:null==v?void 0:v.justOkText),direction:d.direction||f,cancelText:d.cancelText||(null==v?void 0:v.cancelText)},l))});let eH=0,eV=o.memo(o.forwardRef((e,t)=>{let[n,r]=function(){let[e,t]=o.useState([]);return[e,o.useCallback(e=>(t(t=>[].concat((0,a.Z)(t),[e])),()=>{t(t=>t.filter(t=>t!==e))}),[])]}();return o.useImperativeHandle(t,()=>({patchElement:r}),[]),o.createElement(o.Fragment,null,n)}));function eW(e){return eL(eP(e))}ew.useModal=function(){let e=o.useRef(null),[t,n]=o.useState([]);o.useEffect(()=>{t.length&&((0,a.Z)(t).forEach(e=>{e()}),n([]))},[t]);let r=o.useCallback(t=>function(r){var i;let s,l;eH+=1;let c=o.createRef(),u=new Promise(e=>{s=e}),d=!1,p=o.createElement(ez,{key:"modal-".concat(eH),config:t(r),ref:c,afterClose:()=>{null==l||l()},isSilent:()=>d,onConfirm:e=>{s(e)}});return(l=null===(i=e.current)||void 0===i?void 0:i.patchElement(p))&&eI.push(l),{destroy:()=>{function e(){var e;null===(e=c.current)||void 0===e||e.destroy()}c.current?e():n(t=>[].concat((0,a.Z)(t),[e]))},update:e=>{function t(){var t;null===(t=c.current)||void 0===t||t.update(e)}c.current?t():n(e=>[].concat((0,a.Z)(e),[t]))},then:e=>(d=!0,u.then(e))}},[]);return[o.useMemo(()=>({info:r(eD),success:r(eM),error:r(eF),warning:r(eP),confirm:r(eU)}),[]),o.createElement(eV,{key:"modal-holder",ref:e})]},ew.info=function(e){return eL(eD(e))},ew.success=function(e){return eL(eM(e))},ew.error=function(e){return eL(eF(e))},ew.warning=eW,ew.warn=eW,ew.confirm=function(e){return eL(eU(e))},ew.destroyAll=function(){for(;eI.length;){let e=eI.pop();e&&e()}},ew.config=function(e){let{rootPrefixCls:t}=e;e_=t},ew._InternalPanelDoNotUseOrYouWillBeFired=eZ;var eq=ew},4678:function(e,t,n){n.d(t,{A:function(){return l},f:function(){return s}});var r=n(79474);let a=Object.assign({},r.Z.Modal),o=[],i=()=>o.reduce((e,t)=>Object.assign(Object.assign({},e),t),r.Z.Modal);function s(e){if(e){let t=Object.assign({},e);return o.push(t),a=i(),()=>{o=o.filter(e=>e!==t),a=i()}}a=Object.assign({},r.Z.Modal)}function l(){return a}},92801:function(e,t,n){n.d(t,{BR:function(){return f},ri:function(){return p}});var r=n(16480),a=n.n(r),o=n(33054),i=n(64090),s=n(57499),l=n(10693),c=n(86682),u=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let d=i.createContext(null),p=(e,t)=>{let n=i.useContext(d),r=i.useMemo(()=>{if(!n)return"";let{compactDirection:r,isFirstItem:o,isLastItem:i}=n,s="vertical"===r?"-vertical-":"-";return a()("".concat(e,"-compact").concat(s,"item"),{["".concat(e,"-compact").concat(s,"first-item")]:o,["".concat(e,"-compact").concat(s,"last-item")]:i,["".concat(e,"-compact").concat(s,"item-rtl")]:"rtl"===t})},[e,t,n]);return{compactSize:null==n?void 0:n.compactSize,compactDirection:null==n?void 0:n.compactDirection,compactItemClassnames:r}},f=e=>{let{children:t}=e;return i.createElement(d.Provider,{value:null},t)},g=e=>{var{children:t}=e,n=u(e,["children"]);return i.createElement(d.Provider,{value:n},t)};t.ZP=e=>{let{getPrefixCls:t,direction:n}=i.useContext(s.E_),{size:r,direction:p,block:f,prefixCls:m,className:b,rootClassName:h,children:y}=e,E=u(e,["size","direction","block","prefixCls","className","rootClassName","children"]),v=(0,l.Z)(e=>null!=r?r:e),S=t("space-compact",m),[T,w]=(0,c.Z)(S),A=a()(S,w,{["".concat(S,"-rtl")]:"rtl"===n,["".concat(S,"-block")]:f,["".concat(S,"-vertical")]:"vertical"===p},b,h),k=i.useContext(d),R=(0,o.Z)(y),x=i.useMemo(()=>R.map((e,t)=>{let n=e&&e.key||"".concat(S,"-item-").concat(t);return i.createElement(g,{key:n,compactSize:v,compactDirection:p,isFirstItem:0===t&&(!k||(null==k?void 0:k.isFirstItem)),isLastItem:t===R.length-1&&(!k||(null==k?void 0:k.isLastItem))},e)}),[r,R,k]);return 0===R.length?null:T(i.createElement("div",Object.assign({className:A},E),x))}},86682:function(e,t,n){n.d(t,{Z:function(){return l}});var r=n(76585),a=n(80316),o=e=>{let{componentCls:t}=e;return{[t]:{"&-block":{display:"flex",width:"100%"},"&-vertical":{flexDirection:"column"}}}};let i=e=>{let{componentCls:t}=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"}}}},s=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 l=(0,r.I$)("Space",e=>{let t=(0,a.TS)(e,{spaceGapSmallSize:e.paddingXS,spaceGapMiddleSize:e.padding,spaceGapLargeSize:e.paddingLG});return[i(t),s(t),o(t)]},()=>({}),{resetStyle:!1})},12288:function(e,t,n){n.d(t,{c:function(){return r}});function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{focus:!0},{componentCls:n}=e,r="".concat(n,"-compact");return{[r]:Object.assign(Object.assign({},function(e,t,n){let{focusElCls:r,focus:a,borderElCls:o}=n,i=o?"> *":"",s=["hover",a?"focus":null,"active"].filter(Boolean).map(e=>"&:".concat(e," ").concat(i)).join(",");return{["&-item:not(".concat(t,"-last-item)")]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal()},"&-item":Object.assign(Object.assign({[s]:{zIndex:2}},r?{["&".concat(r)]:{zIndex:2}}:{}),{["&[disabled] ".concat(i)]:{zIndex:0}})}}(e,r,t)),function(e,t,n){let{borderElCls:r}=n,a=r?"> ".concat(r):"";return{["&-item:not(".concat(t,"-first-item):not(").concat(t,"-last-item) ").concat(a)]:{borderRadius:0},["&-item:not(".concat(t,"-last-item)").concat(t,"-first-item")]:{["& ".concat(a,", &").concat(e,"-sm ").concat(a,", &").concat(e,"-lg ").concat(a)]:{borderStartEndRadius:0,borderEndEndRadius:0}},["&-item:not(".concat(t,"-first-item)").concat(t,"-last-item")]:{["& ".concat(a,", &").concat(e,"-sm ").concat(a,", &").concat(e,"-lg ").concat(a)]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}(n,r,t))}}},11303:function(e,t,n){n.d(t,{Lx:function(){return l},Qy:function(){return d},Ro:function(){return i},Wf:function(){return o},dF:function(){return s},du:function(){return c},oN:function(){return u},vS:function(){return a}});var r=n(8985);let a={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},o=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"}}),s=()=>({"&::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,\n &:hover":{textDecoration:e.linkHoverDecoration,outline:0},"&:focus":{textDecoration:e.linkFocusDecoration,outline:0},"&[disabled]":{color:e.colorTextDisabled,cursor:"not-allowed"}}}),c=(e,t)=>{let{fontFamily:n,fontSize:r}=e,a='[class^="'.concat(t,'"], [class*=" ').concat(t,'"]');return{[a]:{fontFamily:n,fontSize:r,boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"},[a]:{boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}}}}},u=e=>({outline:"".concat((0,r.bf)(e.lineWidthFocus)," solid ").concat(e.colorPrimaryBorder),outlineOffset:1,transition:"outline-offset 0s, outline 0s"}),d=e=>({"&:focus-visible":Object.assign({},u(e))})},13703:function(e,t,n){n.d(t,{J$:function(){return s}});var r=n(8985),a=n(59353);let o=new r.E4("antFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),i=new r.E4("antFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),s=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{antCls:n}=e,r="".concat(n,"-fade"),s=t?"&":"";return[(0,a.R)(r,o,i,e.motionDurationMid,t),{["\n ".concat(s).concat(r,"-enter,\n ").concat(s).concat(r,"-appear\n ")]:{opacity:0,animationTimingFunction:"linear"},["".concat(s).concat(r,"-leave")]:{animationTimingFunction:"linear"}}]}},59353:function(e,t,n){n.d(t,{R:function(){return o}});let r=e=>({animationDuration:e,animationFillMode:"both"}),a=e=>({animationDuration:e,animationFillMode:"both"}),o=function(e,t,n,o){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=i?"&":"";return{["\n ".concat(s).concat(e,"-enter,\n ").concat(s).concat(e,"-appear\n ")]:Object.assign(Object.assign({},r(o)),{animationPlayState:"paused"}),["".concat(s).concat(e,"-leave")]:Object.assign(Object.assign({},a(o)),{animationPlayState:"paused"}),["\n ".concat(s).concat(e,"-enter").concat(e,"-enter-active,\n ").concat(s).concat(e,"-appear").concat(e,"-appear-active\n ")]:{animationName:t,animationPlayState:"running"},["".concat(s).concat(e,"-leave").concat(e,"-leave-active")]:{animationName:n,animationPlayState:"running",pointerEvents:"none"}}}},58854:function(e,t,n){n.d(t,{_y:function(){return m},kr:function(){return o}});var r=n(8985),a=n(59353);let o=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}}),s=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}}),c=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%"}}),p=new r.E4("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}}),f=new r.E4("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),g={zoom:{inKeyframes:o,outKeyframes:i},"zoom-big":{inKeyframes:s,outKeyframes:l},"zoom-big-fast":{inKeyframes:s,outKeyframes:l},"zoom-left":{inKeyframes:d,outKeyframes:p},"zoom-right":{inKeyframes:f,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:c,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}})}},m=(e,t)=>{let{antCls:n}=e,r="".concat(n,"-").concat(t),{inKeyframes:o,outKeyframes:i}=g[t];return[(0,a.R)(r,o,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}}]}},89869:function(e,t,n){n.d(t,{ZP:function(){return i},qN:function(){return a},wZ:function(){return o}});var r=n(2638);let a=8;function o(e){let{contentRadius:t,limitVerticalRadius:n}=e,r=t>12?t+2:12;return{arrowOffsetHorizontal:r,arrowOffsetVertical:n?a:r}}function i(e,t,n){var a,o,i,s,l,c,u,d;let{componentCls:p,boxShadowPopoverArrow:f,arrowOffsetVertical:g,arrowOffsetHorizontal:m}=e,{arrowDistance:b=0,arrowPlacement:h={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,r.W)(e,t,f)),{"&:before":{background:t}})]},(a=!!h.top,o={[["&-placement-top > ".concat(p,"-arrow"),"&-placement-topLeft > ".concat(p,"-arrow"),"&-placement-topRight > ".concat(p,"-arrow")].join(",")]:{bottom:b,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 > ".concat(p,"-arrow")]:{left:{_skip_check_:!0,value:m}},["&-placement-topRight > ".concat(p,"-arrow")]:{right:{_skip_check_:!0,value:m}}},a?o:{})),(i=!!h.bottom,s={[["&-placement-bottom > ".concat(p,"-arrow"),"&-placement-bottomLeft > ".concat(p,"-arrow"),"&-placement-bottomRight > ".concat(p,"-arrow")].join(",")]:{top:b,transform:"translateY(-100%)"},["&-placement-bottom > ".concat(p,"-arrow")]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},["&-placement-bottomLeft > ".concat(p,"-arrow")]:{left:{_skip_check_:!0,value:m}},["&-placement-bottomRight > ".concat(p,"-arrow")]:{right:{_skip_check_:!0,value:m}}},i?s:{})),(l=!!h.left,c={[["&-placement-left > ".concat(p,"-arrow"),"&-placement-leftTop > ".concat(p,"-arrow"),"&-placement-leftBottom > ".concat(p,"-arrow")].join(",")]:{right:{_skip_check_:!0,value:b},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}},l?c:{})),(u=!!h.right,d={[["&-placement-right > ".concat(p,"-arrow"),"&-placement-rightTop > ".concat(p,"-arrow"),"&-placement-rightBottom > ".concat(p,"-arrow")].join(",")]:{left:{_skip_check_:!0,value:b},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}},u?d:{}))}}},2638:function(e,t,n){n.d(t,{W:function(){return o},w:function(){return a}});var r=n(8985);function a(e){let{sizePopupArrow:t,borderRadiusXS:n,borderRadiusOuter:r}=e,a=t/2,o=1*r/Math.sqrt(2),i=a-r*(1-1/Math.sqrt(2)),s=a-1/Math.sqrt(2)*n,l=r*(Math.sqrt(2)-1)+1/Math.sqrt(2)*n,c=2*a-s,u=2*a-o,d=2*a-0,p=a*Math.sqrt(2)+r*(Math.sqrt(2)-2),f=r*(Math.sqrt(2)-1),g="polygon(".concat(f,"px 100%, 50% ").concat(f,"px, ").concat(2*a-f,"px 100%, ").concat(f,"px 100%)");return{arrowShadowWidth:p,arrowPath:"path('M ".concat(0," ").concat(a," A ").concat(r," ").concat(r," 0 0 0 ").concat(o," ").concat(i," L ").concat(s," ").concat(l," A ").concat(n," ").concat(n," 0 0 1 ").concat(c," ").concat(l," L ").concat(u," ").concat(i," A ").concat(r," ").concat(r," 0 0 0 ").concat(d," ").concat(a," Z')"),arrowPolygon:g}}let o=(e,t,n)=>{let{sizePopupArrow:a,arrowPolygon:o,arrowPath:i,arrowShadowWidth:s,borderRadiusXS:l,calc:c}=e;return{pointerEvents:"none",width:a,height:a,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:a,height:c(a).div(2).equal(),background:t,clipPath:{_multi_value_:!0,value:[o,i]},content:'""'},"&::after":{content:'""',position:"absolute",width:s,height:s,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"}}}},43345:function(e,t,n){n.d(t,{Mj:function(){return y},u_:function(){return h},uH:function(){return b}});var r=n(64090),a=n(8985),o=n(12215),i=e=>{let{controlHeight:t}=e;return{controlHeightSM:.75*t,controlHeightXS:.5*t,controlHeightLG:1.25*t}},s=n(46864),l=n(6336),c=e=>{let t=e,n=e,r=e,a=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?a=4:e>=8&&(a=6),{borderRadius:e,borderRadiusXS:r,borderRadiusSM:n,borderRadiusLG:t,borderRadiusOuter:a}};let u=(e,t)=>new l.C(e).setAlpha(t).toRgbString(),d=(e,t)=>new l.C(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]}},f=(e,t)=>{let n=e||"#fff",r=t||"#000";return{colorBgBase:n,colorTextBase:r,colorText:u(r,.88),colorTextSecondary:u(r,.65),colorTextTertiary:u(r,.45),colorTextQuaternary:u(r,.25),colorFill:u(r,.15),colorFillSecondary:u(r,.06),colorFillTertiary:u(r,.04),colorFillQuaternary:u(r,.02),colorBgLayout:d(n,4),colorBgContainer:d(n,0),colorBgElevated:d(n,0),colorBgSpotlight:u(r,.85),colorBgBlur:"transparent",colorBorder:d(n,15),colorBorderSecondary:d(n,6)}};var g=n(49202),m=e=>{let t=(0,g.Z)(e),n=t.map(e=>e.size),r=t.map(e=>e.lineHeight),a=n[1],o=n[0],i=n[2],s=r[1],l=r[0],c=r[2];return{fontSizeSM:o,fontSize:a,fontSizeLG:i,fontSizeXL:n[3],fontSizeHeading1:n[6],fontSizeHeading2:n[5],fontSizeHeading3:n[4],fontSizeHeading4:n[3],fontSizeHeading5:n[2],lineHeight:s,lineHeightLG:c,lineHeightSM:l,fontHeight:Math.round(s*a),fontHeightLG:Math.round(c*i),fontHeightSM:Math.round(l*o),lineHeightHeading1:r[6],lineHeightHeading2:r[5],lineHeightHeading3:r[4],lineHeightHeading4:r[3],lineHeightHeading5:r[2]}};let b=(0,a.jG)(function(e){let t=Object.keys(s.M).map(t=>{let n=(0,o.R_)(e[t]);return Array(10).fill(1).reduce((e,r,a)=>(e["".concat(t,"-").concat(a+1)]=n[a],e["".concat(t).concat(a+1)]=n[a],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:a,colorWarning:o,colorError:i,colorInfo:s,colorPrimary:c,colorBgBase:u,colorTextBase:d}=e,p=n(c),f=n(a),g=n(o),m=n(i),b=n(s),h=r(u,d),y=n(e.colorLink||e.colorInfo);return Object.assign(Object.assign({},h),{colorPrimaryBg:p[1],colorPrimaryBgHover:p[2],colorPrimaryBorder:p[3],colorPrimaryBorderHover:p[4],colorPrimaryHover:p[5],colorPrimary:p[6],colorPrimaryActive:p[7],colorPrimaryTextHover:p[8],colorPrimaryText:p[9],colorPrimaryTextActive:p[10],colorSuccessBg:f[1],colorSuccessBgHover:f[2],colorSuccessBorder:f[3],colorSuccessBorderHover:f[4],colorSuccessHover:f[4],colorSuccess:f[6],colorSuccessActive:f[7],colorSuccessTextHover:f[8],colorSuccessText:f[9],colorSuccessTextActive:f[10],colorErrorBg:m[1],colorErrorBgHover:m[2],colorErrorBorder:m[3],colorErrorBorderHover:m[4],colorErrorHover:m[5],colorError:m[6],colorErrorActive:m[7],colorErrorTextHover:m[8],colorErrorText:m[9],colorErrorTextActive:m[10],colorWarningBg:g[1],colorWarningBgHover:g[2],colorWarningBorder:g[3],colorWarningBorderHover:g[4],colorWarningHover:g[4],colorWarning:g[6],colorWarningActive:g[7],colorWarningTextHover:g[8],colorWarningText:g[9],colorWarningTextActive:g[10],colorInfoBg:b[1],colorInfoBgHover:b[2],colorInfoBorder:b[3],colorInfoBorderHover:b[4],colorInfoHover:b[4],colorInfo:b[6],colorInfoActive:b[7],colorInfoTextHover:b[8],colorInfoText:b[9],colorInfoTextActive:b[10],colorLinkHover:y[4],colorLink:y[6],colorLinkActive:y[7],colorBgMask:new l.C("#000").setAlpha(.45).toRgbString(),colorWhite:"#fff"})}(e,{generateColorPalettes:p,generateNeutralColorPalettes:f})),m(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)),i(e)),function(e){let{motionUnit:t,motionBase:n,borderRadius:r,lineWidth:a}=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:a+1},c(r))}(e))}),h={token:s.Z,override:{override:s.Z},hashed:!0},y=r.createContext(h)},46864:function(e,t,n){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"},a=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=a},49202:function(e,t,n){function r(e){return(e+8)/e}function a(e){let t=Array(10).fill(null).map((t,n)=>{let r=e*Math.pow(2.71828,(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 a}})},24750:function(e,t,n){n.d(t,{ZP:function(){return h},ID:function(){return g},NJ:function(){return f}});var r=n(64090),a=n(8985),o=n(43345),i=n(46864),s=n(6336);function l(e){return e>=0&&e<=255}var c=function(e,t){let{r:n,g:r,b:a,a:o}=new s.C(e).toRgb();if(o<1)return e;let{r:i,g:c,b:u}=new s.C(t).toRgb();for(let e=.01;e<=1;e+=.01){let t=Math.round((n-i*(1-e))/e),o=Math.round((r-c*(1-e))/e),d=Math.round((a-u*(1-e))/e);if(l(t)&&l(o)&&l(d))return new s.C({r:t,g:o,b:d,a:Math.round(100*e)/100}).toRgbString()}return new s.C({r:n,g:r,b:a,a:1}).toRgbString()},u=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};function d(e){let{override:t}=e,n=u(e,["override"]),r=Object.assign({},t);Object.keys(i.Z).forEach(e=>{delete r[e]});let a=Object.assign(Object.assign({},n),r);return!1===a.motion&&(a.motionDurationFast="0s",a.motionDurationMid="0s",a.motionDurationSlow="0s"),Object.assign(Object.assign(Object.assign({},a),{colorFillContent:a.colorFillSecondary,colorFillContentHover:a.colorFill,colorFillAlter:a.colorFillQuaternary,colorBgContainerDisabled:a.colorFillTertiary,colorBorderBg:a.colorBgContainer,colorSplit:c(a.colorBorderSecondary,a.colorBgContainer),colorTextPlaceholder:a.colorTextQuaternary,colorTextDisabled:a.colorTextQuaternary,colorTextHeading:a.colorText,colorTextLabel:a.colorTextSecondary,colorTextDescription:a.colorTextTertiary,colorTextLightSolid:a.colorWhite,colorHighlight:a.colorError,colorBgTextHover:a.colorFillSecondary,colorBgTextActive:a.colorFill,colorIcon:a.colorTextTertiary,colorIconHover:a.colorText,colorErrorOutline:c(a.colorErrorBg,a.colorBgContainer),colorWarningOutline:c(a.colorWarningBg,a.colorBgContainer),fontSizeIcon:a.fontSizeSM,lineWidthFocus:4*a.lineWidth,lineWidth:a.lineWidth,controlOutlineWidth:2*a.lineWidth,controlInteractiveSize:a.controlHeight/2,controlItemBgHover:a.colorFillTertiary,controlItemBgActive:a.colorPrimaryBg,controlItemBgActiveHover:a.colorPrimaryBgHover,controlItemBgActiveDisabled:a.colorFill,controlTmpOutline:a.colorFillQuaternary,controlOutline:c(a.colorPrimaryBg,a.colorBgContainer),lineType:a.lineType,borderRadius:a.borderRadius,borderRadiusXS:a.borderRadiusXS,borderRadiusSM:a.borderRadiusSM,borderRadiusLG:a.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:a.sizeXXS,paddingXS:a.sizeXS,paddingSM:a.sizeSM,padding:a.size,paddingMD:a.sizeMD,paddingLG:a.sizeLG,paddingXL:a.sizeXL,paddingContentHorizontalLG:a.sizeLG,paddingContentVerticalLG:a.sizeMS,paddingContentHorizontal:a.sizeMS,paddingContentVertical:a.sizeSM,paddingContentHorizontalSM:a.size,paddingContentVerticalSM:a.sizeXS,marginXXS:a.sizeXXS,marginXS:a.sizeXS,marginSM:a.sizeSM,margin:a.size,marginMD:a.sizeMD,marginLG:a.sizeLG,marginXL:a.sizeXL,marginXXL:a.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 s.C("rgba(0, 0, 0, 0.16)").toRgbString(),",\n 0 3px 6px 0 ").concat(new s.C("rgba(0, 0, 0, 0.12)").toRgbString(),",\n 0 5px 12px 4px ").concat(new s.C("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 p=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let f={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0},g={size:!0,sizeSM:!0,sizeLG:!0,sizeMD:!0,sizeXS:!0,sizeXXS:!0,sizeMS:!0,sizeXL:!0,sizeXXL:!0,sizeUnit:!0,sizeStep:!0,motionBase:!0,motionUnit:!0},m={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},b=(e,t,n)=>{let r=n.getDerivativeToken(e),{override:a}=t,o=p(t,["override"]),i=Object.assign(Object.assign({},r),{override:a});return i=d(i),o&&Object.entries(o).forEach(e=>{let[t,n]=e,{theme:r}=n,a=p(n,["theme"]),o=a;r&&(o=b(Object.assign(Object.assign({},i),a),{override:a},r)),i[t]=o}),i};function h(){let{token:e,hashed:t,theme:n,override:s,cssVar:l}=r.useContext(o.Mj),c="".concat("5.13.2","-").concat(t||""),u=n||o.uH,[p,h,y]=(0,a.fp)(u,[i.Z,e],{salt:c,override:s,getComputedToken:b,formatToken:d,cssVar:l&&{prefix:l.prefix,key:l.key,unitless:f,ignore:g,preserve:m}});return[u,y,t?h:"",p,l]}},76585:function(e,t,n){n.d(t,{ZP:function(){return k},I$:function(){return C},bk:function(){return R}});var r=n(64090),a=n(8985);n(48563);var o=n(57499),i=n(11303),s=n(24750),l=n(47365),c=n(65127),u=n(72784),d=n(29676),p=n(68605),f=n(96171);let g=(0,c.Z)(function e(){(0,l.Z)(this,e)}),m=function(e){function t(e){var n,r,a;return(0,l.Z)(this,t),r=t,r=(0,p.Z)(r),(n=(0,u.Z)(this,(0,d.Z)()?Reflect.construct(r,a||[],(0,p.Z)(this).constructor):r.apply(this,a))).result=0,e instanceof t?n.result=e.result:"number"==typeof e&&(n.result=e),n}return(0,f.Z)(t,e),(0,c.Z)(t,[{key:"add",value:function(e){return e instanceof t?this.result+=e.result:"number"==typeof e&&(this.result+=e),this}},{key:"sub",value:function(e){return e instanceof t?this.result-=e.result:"number"==typeof e&&(this.result-=e),this}},{key:"mul",value:function(e){return e instanceof t?this.result*=e.result:"number"==typeof e&&(this.result*=e),this}},{key:"div",value:function(e){return e instanceof t?this.result/=e.result:"number"==typeof e&&(this.result/=e),this}},{key:"equal",value:function(){return this.result}}]),t}(g),b="CALC_UNIT";function h(e){return"number"==typeof e?"".concat(e).concat(b):e}let y=function(e){function t(e){var n,r,a;return(0,l.Z)(this,t),r=t,r=(0,p.Z)(r),(n=(0,u.Z)(this,(0,d.Z)()?Reflect.construct(r,a||[],(0,p.Z)(this).constructor):r.apply(this,a))).result="",e instanceof t?n.result="(".concat(e.result,")"):"number"==typeof e?n.result=h(e):"string"==typeof e&&(n.result=e),n}return(0,f.Z)(t,e),(0,c.Z)(t,[{key:"add",value:function(e){return e instanceof t?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 t?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 t?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 t?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){let{unit:t=!0}=e||{},n=RegExp("".concat(b),"g");return(this.result=this.result.replace(n,t?"px":""),void 0!==this.lowPriority)?"calc(".concat(this.result,")"):this.result}}]),t}(g);var E=e=>{let t="css"===e?y:m;return e=>new t(e)},v=n(80316),S=n(28030);let T=(e,t,n)=>{var r;return"function"==typeof n?n((0,v.TS)(t,null!==(r=t[e])&&void 0!==r?r:{})):null!=n?n:{}},w=(e,t,n,r)=>{let a=Object.assign({},t[e]);if(null==r?void 0:r.deprecatedTokens){let{deprecatedTokens:e}=r;e.forEach(e=>{var t;let[n,r]=e;((null==a?void 0:a[n])||(null==a?void 0:a[r]))&&(null!==(t=a[r])&&void 0!==t||(a[r]=null==a?void 0:a[n]))})}let o=Object.assign(Object.assign({},n),a);return Object.keys(o).forEach(e=>{o[e]===t[e]&&delete o[e]}),o},A=(e,t)=>"".concat([t,e.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-"));function k(e,t,n){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=Array.isArray(e)?e:[e,e],[u]=c,d=c.join("-");return e=>{let[c,p,f,g,m]=(0,s.ZP)(),{getPrefixCls:b,iconPrefixCls:h,csp:y}=(0,r.useContext)(o.E_),k=b(),R=m?"css":"js",x=E(R),{max:C,min:N}="js"===R?{max:Math.max,min:Math.min}:{max:function(){for(var e=arguments.length,t=Array(e),n=0;n(0,a.bf)(e)).join(","),")")},min:function(){for(var e=arguments.length,t=Array(e),n=0;n(0,a.bf)(e)).join(","),")")}},I={theme:c,token:g,hashId:f,nonce:()=>null==y?void 0:y.nonce,clientOnly:l.clientOnly,order:l.order||-999};return(0,a.xy)(Object.assign(Object.assign({},I),{clientOnly:!1,path:["Shared",k]}),()=>[{"&":(0,i.Lx)(g)}]),(0,S.Z)(h,y),[(0,a.xy)(Object.assign(Object.assign({},I),{path:[d,e,h]}),()=>{if(!1===l.injectStyle)return[];let{token:r,flush:o}=(0,v.ZP)(g),s=T(u,p,n),c=".".concat(e),d=w(u,p,s,{deprecatedTokens:l.deprecatedTokens});m&&Object.keys(s).forEach(e=>{s[e]="var(".concat((0,a.ks)(e,A(u,m.prefix)),")")});let b=(0,v.TS)(r,{componentCls:c,prefixCls:e,iconCls:".".concat(h),antCls:".".concat(k),calc:x,max:C,min:N},m?s:d),y=t(b,{hashId:f,prefixCls:e,rootPrefixCls:k,iconPrefixCls:h});return o(u,d),[!1===l.resetStyle?null:(0,i.du)(b,e),y]}),f]}}let R=(e,t,n,r)=>{let a=k(e,t,n,Object.assign({resetStyle:!1,order:-998},r));return e=>{let{prefixCls:t}=e;return a(t),null}},x=(e,t,n)=>{function o(t){return"".concat(e).concat(t.slice(0,1).toUpperCase()).concat(t.slice(1))}let{unitless:i={},injectStyle:l=!0}=null!=n?n:{},c={[o("zIndexPopup")]:!0};Object.keys(i).forEach(e=>{c[o(e)]=i[e]});let u=r=>{let{rootCls:i,cssVar:l}=r,[,u]=(0,s.ZP)();return(0,a.CI)({path:[e],prefix:l.prefix,key:null==l?void 0:l.key,unitless:Object.assign(Object.assign({},s.NJ),c),ignore:s.ID,token:u,scope:i},()=>{let r=T(e,u,t),a=w(e,u,r,{deprecatedTokens:null==n?void 0:n.deprecatedTokens});return Object.keys(r).forEach(e=>{a[o(e)]=a[e],delete a[e]}),a}),null};return t=>{let[,,,,n]=(0,s.ZP)();return[a=>l&&n?r.createElement(r.Fragment,null,r.createElement(u,{rootCls:t,cssVar:n,component:e}),a):a,null==n?void 0:n.key]}},C=(e,t,n,r)=>{let a=k(e,t,n,r),o=x(Array.isArray(e)?e[0]:e,n,r);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,[,n]=a(e),[r,i]=o(t);return[r,n,i]}}},80316:function(e,t,n){n.d(t,{TS:function(){return o}});let r="undefined"!=typeof CSSINJS_STATISTIC,a=!0;function o(){for(var e=arguments.length,t=Array(e),n=0;n{Object.keys(e).forEach(t=>{Object.defineProperty(o,t,{configurable:!0,enumerable:!0,get:()=>e[t]})})}),a=!0,o}let i={};function s(){}t.ZP=e=>{let t;let n=e,o=s;return r&&"undefined"!=typeof Proxy&&(t=new Set,n=new Proxy(e,{get:(e,n)=>(a&&t.add(n),e[n])}),o=(e,n)=>{var r;i[e]={global:Array.from(t),component:Object.assign(Object.assign({},null===(r=i[e])||void 0===r?void 0:r.component),n)}}),{token:n,keys:t,flush:o}}},28030:function(e,t,n){var r=n(8985),a=n(11303),o=n(24750);t.Z=(e,t)=>{let[n,i]=(0,o.ZP)();return(0,r.xy)({theme:n,token:i,hashId:"",path:["ant-design-icons",e],nonce:()=>null==t?void 0:t.nonce},()=>[{[".".concat(e)]:Object.assign(Object.assign({},(0,a.Ro)()),{[".".concat(e," .").concat(e,"-icon")]:{display:"block"}})}])}},1460:function(e,t,n){n.d(t,{Z:function(){return $}});var r=n(64090),a=n(16480),o=n.n(a);function i(e){var t=e.children,n=e.prefixCls,a=e.id,i=e.overlayInnerStyle,s=e.className,l=e.style;return r.createElement("div",{className:o()("".concat(n,"-content"),s),style:l},r.createElement("div",{className:"".concat(n,"-inner"),id:a,role:"tooltip",style:i},"function"==typeof t?t():t))}var s=n(14749),l=n(5239),c=n(60635),u=n(44101),d={shiftX:64,adjustY:1},p={adjustX:1,shiftY:!0},f=[0,0],g={left:{points:["cr","cl"],overflow:p,offset:[-4,0],targetOffset:f},right:{points:["cl","cr"],overflow:p,offset:[4,0],targetOffset:f},top:{points:["bc","tc"],overflow:d,offset:[0,-4],targetOffset:f},bottom:{points:["tc","bc"],overflow:d,offset:[0,4],targetOffset:f},topLeft:{points:["bl","tl"],overflow:d,offset:[0,-4],targetOffset:f},leftTop:{points:["tr","tl"],overflow:p,offset:[-4,0],targetOffset:f},topRight:{points:["br","tr"],overflow:d,offset:[0,-4],targetOffset:f},rightTop:{points:["tl","tr"],overflow:p,offset:[4,0],targetOffset:f},bottomRight:{points:["tr","br"],overflow:d,offset:[0,4],targetOffset:f},rightBottom:{points:["bl","br"],overflow:p,offset:[4,0],targetOffset:f},bottomLeft:{points:["tl","bl"],overflow:d,offset:[0,4],targetOffset:f},leftBottom:{points:["br","bl"],overflow:p,offset:[-4,0],targetOffset:f}},m=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],b=(0,r.forwardRef)(function(e,t){var n=e.overlayClassName,a=e.trigger,o=e.mouseEnterDelay,d=e.mouseLeaveDelay,p=e.overlayStyle,f=e.prefixCls,b=void 0===f?"rc-tooltip":f,h=e.children,y=e.onVisibleChange,E=e.afterVisibleChange,v=e.transitionName,S=e.animation,T=e.motion,w=e.placement,A=e.align,k=e.destroyTooltipOnHide,R=e.defaultVisible,x=e.getTooltipContainer,C=e.overlayInnerStyle,N=(e.arrowContent,e.overlay),I=e.id,_=e.showArrow,O=(0,c.Z)(e,m),L=(0,r.useRef)(null);(0,r.useImperativeHandle)(t,function(){return L.current});var P=(0,l.Z)({},O);return"visible"in e&&(P.popupVisible=e.visible),r.createElement(u.Z,(0,s.Z)({popupClassName:n,prefixCls:b,popup:function(){return r.createElement(i,{key:"content",prefixCls:b,id:I,overlayInnerStyle:C},N)},action:void 0===a?["hover"]:a,builtinPlacements:g,popupPlacement:void 0===w?"right":w,ref:L,popupAlign:void 0===A?{}:A,getPopupContainer:x,onPopupVisibleChange:y,afterPopupVisibleChange:E,popupTransitionName:v,popupAnimation:S,popupMotion:T,defaultPopupVisible:R,autoDestroy:void 0!==k&&k,mouseLeaveDelay:void 0===d?.1:d,popupStyle:p,mouseEnterDelay:void 0===o?0:o,arrow:void 0===_||_},P),h)}),h=n(44329),y=n(51761),E=n(47387),v=n(67966),S=n(65823),T=n(76564),w=n(86718),A=n(57499),k=n(92801),R=n(24750),x=n(11303),C=n(58854),N=n(89869);let I=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"];var _=n(80316),O=n(76585),L=n(8985),P=n(2638);let D=e=>{var t;let{componentCls:n,tooltipMaxWidth:r,tooltipColor:a,tooltipBg:o,tooltipBorderRadius:i,zIndexPopup:s,controlHeight:l,boxShadowSecondary:c,paddingSM:u,paddingXS:d}=e;return[{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,x.Wf)(e)),{position:"absolute",zIndex:s,display:"block",width:"max-content",maxWidth:r,visibility:"visible",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","&-hidden":{display:"none"},"--antd-arrow-background-color":o,["".concat(n,"-inner")]:{minWidth:l,minHeight:l,padding:"".concat((0,L.bf)(e.calc(u).div(2).equal())," ").concat((0,L.bf)(d)),color:a,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:o,borderRadius:i,boxShadow:c,boxSizing:"border-box"},"&-placement-left,&-placement-leftTop,&-placement-leftBottom,&-placement-right,&-placement-rightTop,&-placement-rightBottom":{["".concat(n,"-inner")]:{borderRadius:e.min(i,N.qN)}},["".concat(n,"-content")]:{position:"relative"}}),(t=(e,t)=>{let{darkColor:r}=t;return{["&".concat(n,"-").concat(e)]:{["".concat(n,"-inner")]:{backgroundColor:r},["".concat(n,"-arrow")]:{"--antd-arrow-background-color":r}}}},I.reduce((n,r)=>{let a=e["".concat(r,"1")],o=e["".concat(r,"3")],i=e["".concat(r,"6")],s=e["".concat(r,"7")];return Object.assign(Object.assign({},n),t(r,{lightColor:a,lightBorderColor:o,darkColor:i,textColor:s}))},{}))),{"&-rtl":{direction:"rtl"}})},(0,N.ZP)(e,"var(--antd-arrow-background-color)"),{["".concat(n,"-pure")]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow}}]},M=e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+70},(0,N.wZ)({contentRadius:e.borderRadius,limitVerticalRadius:!0})),(0,P.w)((0,_.TS)(e,{borderRadiusOuter:Math.min(e.borderRadiusOuter,4)})));function F(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return(0,O.I$)("Tooltip",e=>{let{borderRadius:t,colorTextLightSolid:n,colorBgSpotlight:r}=e;return[D((0,_.TS)(e,{tooltipMaxWidth:250,tooltipColor:n,tooltipBorderRadius:t,tooltipBg:r})),(0,C._y)(e,"zoom-big-fast")]},M,{resetStyle:!1,injectStyle:t})(e)}var U=n(63787);let B=I.map(e=>"".concat(e,"-inverse"));function G(e,t){let n=function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return t?[].concat((0,U.Z)(B),(0,U.Z)(I)).includes(e):I.includes(e)}(t),r=o()({["".concat(e,"-").concat(t)]:t&&n}),a={},i={};return t&&!n&&(a.background=t,i["--antd-arrow-background-color"]=t),{className:r,overlayStyle:a,arrowStyle:i}}var 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 a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let j=r.forwardRef((e,t)=>{var n,a;let{prefixCls:i,openClassName:s,getTooltipContainer:l,overlayClassName:c,color:u,overlayInnerStyle:d,children:p,afterOpenChange:f,afterVisibleChange:g,destroyTooltipOnHide:m,arrow:x=!0,title:C,overlay:N,builtinPlacements:I,arrowPointAtCenter:_=!1,autoAdjustOverflow:O=!0}=e,L=!!x,[,P]=(0,R.ZP)(),{getPopupContainer:D,getPrefixCls:M,direction:U}=r.useContext(A.E_),B=(0,T.ln)("Tooltip"),j=r.useRef(null),$=()=>{var e;null===(e=j.current)||void 0===e||e.forceAlign()};r.useImperativeHandle(t,()=>({forceAlign:$,forcePopupAlign:()=>{B.deprecated(!1,"forcePopupAlign","forceAlign"),$()}}));let[z,H]=(0,h.Z)(!1,{value:null!==(n=e.open)&&void 0!==n?n:e.visible,defaultValue:null!==(a=e.defaultOpen)&&void 0!==a?a:e.defaultVisible}),V=!C&&!N&&0!==C,W=r.useMemo(()=>{var e,t;let n=_;return"object"==typeof x&&(n=null!==(t=null!==(e=x.pointAtCenter)&&void 0!==e?e:x.arrowPointAtCenter)&&void 0!==t?t:_),I||(0,v.Z)({arrowPointAtCenter:n,autoAdjustOverflow:O,arrowWidth:L?P.sizePopupArrow:0,borderRadius:P.borderRadius,offset:P.marginXXS,visibleFirst:!0})},[_,x,I,P]),q=r.useMemo(()=>0===C?C:N||C||"",[N,C]),Y=r.createElement(k.BR,null,"function"==typeof q?q():q),{getPopupContainer:K,placement:X="top",mouseEnterDelay:Q=.1,mouseLeaveDelay:J=.1,overlayStyle:ee,rootClassName:et}=e,en=Z(e,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),er=M("tooltip",i),ea=M(),eo=e["data-popover-inject"],ei=z;"open"in e||"visible"in e||!V||(ei=!1);let es=(0,S.l$)(p)&&!(0,S.M2)(p)?p:r.createElement("span",null,p),el=es.props,ec=el.className&&"string"!=typeof el.className?el.className:o()(el.className,s||"".concat(er,"-open")),[eu,ed,ep]=F(er,!eo),ef=G(er,u),eg=ef.arrowStyle,em=Object.assign(Object.assign({},d),ef.overlayStyle),eb=o()(c,{["".concat(er,"-rtl")]:"rtl"===U},ef.className,et,ed,ep),[eh,ey]=(0,y.Cn)("Tooltip",en.zIndex),eE=r.createElement(b,Object.assign({},en,{zIndex:eh,showArrow:L,placement:X,mouseEnterDelay:Q,mouseLeaveDelay:J,prefixCls:er,overlayClassName:eb,overlayStyle:Object.assign(Object.assign({},eg),ee),getTooltipContainer:K||l||D,ref:j,builtinPlacements:W,overlay:Y,visible:ei,onVisibleChange:t=>{var n,r;H(!V&&t),V||(null===(n=e.onOpenChange)||void 0===n||n.call(e,t),null===(r=e.onVisibleChange)||void 0===r||r.call(e,t))},afterVisibleChange:null!=f?f:g,overlayInnerStyle:em,arrowContent:r.createElement("span",{className:"".concat(er,"-arrow-content")}),motion:{motionName:(0,E.m)(ea,"zoom-big-fast",e.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!m}),ei?(0,S.Tm)(es,{className:ec}):es);return eu(r.createElement(w.Z.Provider,{value:ey},eE))});j._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:t,className:n,placement:a="top",title:s,color:l,overlayInnerStyle:c}=e,{getPrefixCls:u}=r.useContext(A.E_),d=u("tooltip",t),[p,f,g]=F(d),m=G(d,l),b=m.arrowStyle,h=Object.assign(Object.assign({},c),m.overlayStyle),y=o()(f,g,d,"".concat(d,"-pure"),"".concat(d,"-placement-").concat(a),n,m.className);return p(r.createElement("div",{className:y,style:b},r.createElement("div",{className:"".concat(d,"-arrow")}),r.createElement(i,Object.assign({},e,{className:f,prefixCls:d,overlayInnerStyle:h}),s)))};var $=j},44056:function(e){e.exports=function(e,n){for(var r,a,o,i=e||"",s=n||"div",l={},c=0;c4&&g.slice(0,4)===i&&s.test(t)&&("-"===t.charAt(4)?m=i+(n=t.slice(5).replace(l,d)).charAt(0).toUpperCase()+n.slice(1):(f=(p=t).slice(4),t=l.test(f)?p:("-"!==(f=f.replace(c,u)).charAt(0)&&(f="-"+f),i+f)),b=a),new b(m,t))};var s=/^data[-\w.:]+$/i,l=/-[a-z]/g,c=/[A-Z]/g;function u(e){return"-"+e.toLowerCase()}function d(e){return e.charAt(1).toUpperCase()}},31872:function(e,t,n){var r=n(96130),a=n(64730),o=n(61861),i=n(46982),s=n(83671),l=n(53618);e.exports=r([o,a,i,s,l])},83671:function(e,t,n){var r=n(7667),a=n(13585),o=r.booleanish,i=r.number,s=r.spaceSeparated;e.exports=a({transform:function(e,t){return"role"===t?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:o,ariaAutoComplete:null,ariaBusy:o,ariaChecked:o,ariaColCount:i,ariaColIndex:i,ariaColSpan:i,ariaControls:s,ariaCurrent:null,ariaDescribedBy:s,ariaDetails:null,ariaDisabled:o,ariaDropEffect:s,ariaErrorMessage:null,ariaExpanded:o,ariaFlowTo:s,ariaGrabbed:o,ariaHasPopup:null,ariaHidden:o,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:s,ariaLevel:i,ariaLive:null,ariaModal:o,ariaMultiLine:o,ariaMultiSelectable:o,ariaOrientation:null,ariaOwns:s,ariaPlaceholder:null,ariaPosInSet:i,ariaPressed:o,ariaReadOnly:o,ariaRelevant:null,ariaRequired:o,ariaRoleDescription:s,ariaRowCount:i,ariaRowIndex:i,ariaRowSpan:i,ariaSelected:o,ariaSetSize:i,ariaSort:null,ariaValueMax:i,ariaValueMin:i,ariaValueNow:i,ariaValueText:null,role:null}})},53618:function(e,t,n){var r=n(7667),a=n(13585),o=n(46640),i=r.boolean,s=r.overloadedBoolean,l=r.booleanish,c=r.number,u=r.spaceSeparated,d=r.commaSeparated;e.exports=a({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:o,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:d,acceptCharset:u,accessKey:u,action:null,allow:null,allowFullScreen:i,allowPaymentRequest:i,allowUserMedia:i,alt:null,as:null,async:i,autoCapitalize:null,autoComplete:u,autoFocus:i,autoPlay:i,capture:i,charSet:null,checked:i,cite:null,className:u,cols:c,colSpan:null,content:null,contentEditable:l,controls:i,controlsList:u,coords:c|d,crossOrigin:null,data:null,dateTime:null,decoding:null,default:i,defer:i,dir:null,dirName:null,disabled:i,download:s,draggable:l,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:i,formTarget:null,headers:u,height:c,hidden:i,high:c,href:null,hrefLang:null,htmlFor:u,httpEquiv:u,id:null,imageSizes:null,imageSrcSet:d,inputMode:null,integrity:null,is:null,isMap:i,itemId:null,itemProp:u,itemRef:u,itemScope:i,itemType:u,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:i,low:c,manifest:null,max:null,maxLength:c,media:null,method:null,min:null,minLength:c,multiple:i,muted:i,name:null,nonce:null,noModule:i,noValidate:i,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextMenu:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:i,optimum:c,pattern:null,ping:u,placeholder:null,playsInline:i,poster:null,preload:null,readOnly:i,referrerPolicy:null,rel:u,required:i,reversed:i,rows:c,rowSpan:c,sandbox:u,scope:null,scoped:i,seamless:i,selected:i,shape:null,size:c,sizes:null,slot:null,span:c,spellCheck:l,src:null,srcDoc:null,srcLang:null,srcSet:d,start:c,step:null,style:null,tabIndex:c,target:null,title:null,translate:null,type:null,typeMustMatch:i,useMap:null,value:l,width:c,wrap:null,align:null,aLink:null,archive:u,axis:null,background:null,bgColor:null,border:c,borderColor:null,bottomMargin:c,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:i,declare:i,event:null,face:null,frame:null,frameBorder:null,hSpace:c,leftMargin:c,link:null,longDesc:null,lowSrc:null,marginHeight:c,marginWidth:c,noResize:i,noHref:i,noShade:i,noWrap:i,object:null,profile:null,prompt:null,rev:null,rightMargin:c,rules:null,scheme:null,scrolling:l,standby:null,summary:null,text:null,topMargin:c,valueType:null,version:null,vAlign:null,vLink:null,vSpace:c,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:i,disableRemotePlayback:i,prefix:null,property:null,results:c,security:null,unselectable:null}})},46640:function(e,t,n){var r=n(25852);e.exports=function(e,t){return r(e,t.toLowerCase())}},25852:function(e){e.exports=function(e,t){return t in e?e[t]:t}},13585:function(e,t,n){var r=n(39900),a=n(94949),o=n(7478);e.exports=function(e){var t,n,i=e.space,s=e.mustUseProperty||[],l=e.attributes||{},c=e.properties,u=e.transform,d={},p={};for(t in c)n=new o(t,u(l,t),c[t],i),-1!==s.indexOf(t)&&(n.mustUseProperty=!0),d[t]=n,p[r(t)]=t,p[r(n.attribute)]=t;return new a(d,p,i)}},7478:function(e,t,n){var r=n(74108),a=n(7667);e.exports=s,s.prototype=new r,s.prototype.defined=!0;var o=["boolean","booleanish","overloadedBoolean","number","commaSeparated","spaceSeparated","commaOrSpaceSeparated"],i=o.length;function s(e,t,n,s){var l,c,u,d=-1;for(s&&(this.space=s),r.call(this,e,t);++d1)for(var n=1;n1?t-1:0),r=1;r=o)return e;switch(e){case"%s":return String(n[a++]);case"%d":return Number(n[a++]);case"%j":try{return JSON.stringify(n[a++])}catch(e){return"[Circular]"}break;default:return e}}):e}function P(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 D(e,t,n){var r=0,a=e.length;!function o(i){if(i&&i.length){n(i);return}var s=r;r+=1,s()\[\]\\.,;:\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},j={integer:function(e){return j.number(e)&&parseInt(e,10)===e},float:function(e){return j.number(e)&&!j.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"==typeof e&&!j.array(e)},method:function(e){return"function"==typeof e},email:function(e){return"string"==typeof e&&e.length<=320&&!!e.match(Z.email)},url:function(e){return"string"==typeof e&&e.length<=2048&&!!e.match(G())},hex:function(e){return"string"==typeof e&&!!e.match(Z.hex)}},$="enum",z={required:B,whitespace:function(e,t,n,r,a){(/^\s+$/.test(t)||""===t)&&r.push(L(a.messages.whitespace,e.fullField))},type:function(e,t,n,r,a){if(e.required&&void 0===t){B(e,t,n,r,a);return}var o=e.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(o)>-1?j[o](t)||r.push(L(a.messages.types[o],e.fullField,e.type)):o&&typeof t!==e.type&&r.push(L(a.messages.types[o],e.fullField,e.type))},range:function(e,t,n,r,a){var o="number"==typeof e.len,i="number"==typeof e.min,s="number"==typeof e.max,l=t,c=null,u="number"==typeof t,d="string"==typeof t,p=Array.isArray(t);if(u?c="number":d?c="string":p&&(c="array"),!c)return!1;p&&(l=t.length),d&&(l=t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),o?l!==e.len&&r.push(L(a.messages[c].len,e.fullField,e.len)):i&&!s&&le.max?r.push(L(a.messages[c].max,e.fullField,e.max)):i&&s&&(le.max)&&r.push(L(a.messages[c].range,e.fullField,e.min,e.max))},enum:function(e,t,n,r,a){e[$]=Array.isArray(e[$])?e[$]:[],-1===e[$].indexOf(t)&&r.push(L(a.messages[$],e.fullField,e[$].join(", ")))},pattern:function(e,t,n,r,a){!e.pattern||(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(t)||r.push(L(a.messages.pattern.mismatch,e.fullField,t,e.pattern))):"string"!=typeof e.pattern||new RegExp(e.pattern).test(t)||r.push(L(a.messages.pattern.mismatch,e.fullField,t,e.pattern)))}},H=function(e,t,n,r,a){var o=e.type,i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(P(t,o)&&!e.required)return n();z.required(e,t,r,i,a,o),P(t,o)||z.type(e,t,r,i,a)}n(i)},V={string:function(e,t,n,r,a){var o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(P(t,"string")&&!e.required)return n();z.required(e,t,r,o,a,"string"),P(t,"string")||(z.type(e,t,r,o,a),z.range(e,t,r,o,a),z.pattern(e,t,r,o,a),!0===e.whitespace&&z.whitespace(e,t,r,o,a))}n(o)},method:function(e,t,n,r,a){var o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(P(t)&&!e.required)return n();z.required(e,t,r,o,a),void 0!==t&&z.type(e,t,r,o,a)}n(o)},number:function(e,t,n,r,a){var o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(""===t&&(t=void 0),P(t)&&!e.required)return n();z.required(e,t,r,o,a),void 0!==t&&(z.type(e,t,r,o,a),z.range(e,t,r,o,a))}n(o)},boolean:function(e,t,n,r,a){var o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(P(t)&&!e.required)return n();z.required(e,t,r,o,a),void 0!==t&&z.type(e,t,r,o,a)}n(o)},regexp:function(e,t,n,r,a){var o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(P(t)&&!e.required)return n();z.required(e,t,r,o,a),P(t)||z.type(e,t,r,o,a)}n(o)},integer:function(e,t,n,r,a){var o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(P(t)&&!e.required)return n();z.required(e,t,r,o,a),void 0!==t&&(z.type(e,t,r,o,a),z.range(e,t,r,o,a))}n(o)},float:function(e,t,n,r,a){var o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(P(t)&&!e.required)return n();z.required(e,t,r,o,a),void 0!==t&&(z.type(e,t,r,o,a),z.range(e,t,r,o,a))}n(o)},array:function(e,t,n,r,a){var o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(null==t&&!e.required)return n();z.required(e,t,r,o,a,"array"),null!=t&&(z.type(e,t,r,o,a),z.range(e,t,r,o,a))}n(o)},object:function(e,t,n,r,a){var o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(P(t)&&!e.required)return n();z.required(e,t,r,o,a),void 0!==t&&z.type(e,t,r,o,a)}n(o)},enum:function(e,t,n,r,a){var o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(P(t)&&!e.required)return n();z.required(e,t,r,o,a),void 0!==t&&z.enum(e,t,r,o,a)}n(o)},pattern:function(e,t,n,r,a){var o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(P(t,"string")&&!e.required)return n();z.required(e,t,r,o,a),P(t,"string")||z.pattern(e,t,r,o,a)}n(o)},date:function(e,t,n,r,a){var o,i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(P(t,"date")&&!e.required)return n();z.required(e,t,r,i,a),!P(t,"date")&&(o=t instanceof Date?t:new Date(t),z.type(e,o,r,i,a),o&&z.range(e,o.getTime(),r,i,a))}n(i)},url:H,hex:H,email:H,required:function(e,t,n,r,a){var o=[],i=Array.isArray(t)?"array":typeof t;z.required(e,t,r,o,a,i),n(o)},any:function(e,t,n,r,a){var o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(P(t)&&!e.required)return n();z.required(e,t,r,o,a)}n(o)}};function W(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var q=W(),Y=function(){function e(e){this.rules=null,this._messages=q,this.define(e)}var t=e.prototype;return t.define=function(e){var t=this;if(!e)throw Error("Cannot configure a schema with no rules");if("object"!=typeof 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]})},t.messages=function(e){return e&&(this._messages=U(W(),e)),this._messages},t.validate=function(t,n,r){var a=this;void 0===n&&(n={}),void 0===r&&(r=function(){});var o=t,i=n,s=r;if("function"==typeof i&&(s=i,i={}),!this.rules||0===Object.keys(this.rules).length)return s&&s(null,o),Promise.resolve(o);if(i.messages){var l=this.messages();l===q&&(l=W()),U(l,i.messages),i.messages=l}else i.messages=this.messages();var c={};(i.keys||Object.keys(this.rules)).forEach(function(e){var n=a.rules[e],r=o[e];n.forEach(function(n){var i=n;"function"==typeof i.transform&&(o===t&&(o=R({},o)),r=o[e]=i.transform(r)),(i="function"==typeof i?{validator:i}:R({},i)).validator=a.getValidationMethod(i),i.validator&&(i.field=e,i.fullField=i.fullField||e,i.type=a.getType(i),c[e]=c[e]||[],c[e].push({rule:i,value:r,source:o,field:e}))})});var u={};return function(e,t,n,r,a){if(t.first){var o=new Promise(function(t,o){var i;D((i=[],Object.keys(e).forEach(function(t){i.push.apply(i,e[t]||[])}),i),n,function(e){return r(e),e.length?o(new M(e,O(e))):t(a)})});return o.catch(function(e){return e}),o}var i=!0===t.firstFields?Object.keys(e):t.firstFields||[],s=Object.keys(e),l=s.length,c=0,u=[],d=new Promise(function(t,o){var d=function(e){if(u.push.apply(u,e),++c===l)return r(u),u.length?o(new M(u,O(u))):t(a)};s.length||(r(u),t(a)),s.forEach(function(t){var r=e[t];-1!==i.indexOf(t)?D(r,n,d):function(e,t,n){var r=[],a=0,o=e.length;function i(e){r.push.apply(r,e||[]),++a===o&&n(r)}e.forEach(function(e){t(e,i)})}(r,n,d)})});return d.catch(function(e){return e}),d}(c,i,function(t,n){var r,a=t.rule,s=("object"===a.type||"array"===a.type)&&("object"==typeof a.fields||"object"==typeof a.defaultField);function l(e,t){return R({},t,{fullField:a.fullField+"."+e,fullFields:a.fullFields?[].concat(a.fullFields,[e]):[e]})}function c(r){void 0===r&&(r=[]);var c=Array.isArray(r)?r:[r];!i.suppressWarning&&c.length&&e.warning("async-validator:",c),c.length&&void 0!==a.message&&(c=[].concat(a.message));var d=c.map(F(a,o));if(i.first&&d.length)return u[a.field]=1,n(d);if(s){if(a.required&&!t.value)return void 0!==a.message?d=[].concat(a.message).map(F(a,o)):i.error&&(d=[i.error(a,L(i.messages.required,a.field))]),n(d);var p={};a.defaultField&&Object.keys(t.value).map(function(e){p[e]=a.defaultField});var f={};Object.keys(p=R({},p,t.rule.fields)).forEach(function(e){var t=p[e],n=Array.isArray(t)?t:[t];f[e]=n.map(l.bind(null,e))});var g=new e(f);g.messages(i.messages),t.rule.options&&(t.rule.options.messages=i.messages,t.rule.options.error=i.error),g.validate(t.value,t.rule.options||i,function(e){var t=[];d&&d.length&&t.push.apply(t,d),e&&e.length&&t.push.apply(t,e),n(t.length?t:null)})}else n(d)}if(s=s&&(a.required||!a.required&&t.value),a.field=t.field,a.asyncValidator)r=a.asyncValidator(a,t.value,c,t.source,i);else if(a.validator){try{r=a.validator(a,t.value,c,t.source,i)}catch(e){null==console.error||console.error(e),i.suppressValidatorError||setTimeout(function(){throw e},0),c(e.message)}!0===r?c():!1===r?c("function"==typeof a.message?a.message(a.fullField||a.field):a.message||(a.fullField||a.field)+" fails"):r instanceof Array?c(r):r instanceof Error&&c(r.message)}r&&r.then&&r.then(function(){return c()},function(e){return c(e)})},function(e){!function(e){for(var t=[],n={},r=0;r2&&void 0!==arguments[2]&&arguments[2];return e&&e.some(function(e){return ec(t,e,n)})}function ec(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 eu(e){var t=arguments.length<=1?void 0:arguments[1];return t&&t.target&&"object"===(0,ea.Z)(t.target)&&e in t.target?t.target[e]:t}function ed(e,t,n){var r=e.length;if(t<0||t>=r||n<0||n>=r)return e;var a=e[t],o=t-n;return o>0?[].concat((0,u.Z)(e.slice(0,n)),[a],(0,u.Z)(e.slice(n,t)),(0,u.Z)(e.slice(t+1,r))):o<0?[].concat((0,u.Z)(e.slice(0,t)),(0,u.Z)(e.slice(t+1,n+1)),[a],(0,u.Z)(e.slice(n+1,r))):e}var ep=["name"],ef=[];function eg(e,t,n,r,a,o){return"function"==typeof e?e(t,n,"source"in o?{source:o.source}:{}):r!==a}var em=function(e){(0,g.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,d.Z)(this,n),r=t.call(this,e),(0,b.Z)((0,f.Z)(r),"state",{resetCount:0}),(0,b.Z)((0,f.Z)(r),"cancelRegisterFunc",null),(0,b.Z)((0,f.Z)(r),"mounted",!1),(0,b.Z)((0,f.Z)(r),"touched",!1),(0,b.Z)((0,f.Z)(r),"dirty",!1),(0,b.Z)((0,f.Z)(r),"validatePromise",void 0),(0,b.Z)((0,f.Z)(r),"prevValidating",void 0),(0,b.Z)((0,f.Z)(r),"errors",ef),(0,b.Z)((0,f.Z)(r),"warnings",ef),(0,b.Z)((0,f.Z)(r),"cancelRegister",function(){var e=r.props,t=e.preserve,n=e.isListField,a=e.name;r.cancelRegisterFunc&&r.cancelRegisterFunc(n,t,ei(a)),r.cancelRegisterFunc=null}),(0,b.Z)((0,f.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,b.Z)((0,f.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,b.Z)((0,f.Z)(r),"refresh",function(){r.mounted&&r.setState(function(e){return{resetCount:e.resetCount+1}})}),(0,b.Z)((0,f.Z)(r),"metaCache",null),(0,b.Z)((0,f.Z)(r),"triggerMetaEvent",function(e){var t=r.props.onMetaChange;if(t){var n=(0,c.Z)((0,c.Z)({},r.getMeta()),{},{destroy:e});(0,y.Z)(r.metaCache,n)||t(n),r.metaCache=n}else r.metaCache=null}),(0,b.Z)((0,f.Z)(r),"onStoreChange",function(e,t,n){var a=r.props,o=a.shouldUpdate,i=a.dependencies,s=void 0===i?[]:i,l=a.onReset,c=n.store,u=r.getNamePath(),d=r.getValue(e),p=r.getValue(c),f=t&&el(t,u);switch("valueUpdate"===n.type&&"external"===n.source&&d!==p&&(r.touched=!0,r.dirty=!0,r.validatePromise=null,r.errors=ef,r.warnings=ef,r.triggerMetaEvent()),n.type){case"reset":if(!t||f){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(o){r.reRender();return}break;case"setField":var g=n.data;if(f){"touched"in g&&(r.touched=g.touched),"validating"in g&&!("originRCField"in g)&&(r.validatePromise=g.validating?Promise.resolve([]):null),"errors"in g&&(r.errors=g.errors||ef),"warnings"in g&&(r.warnings=g.warnings||ef),r.dirty=!0,r.triggerMetaEvent(),r.reRender();return}if("value"in g&&el(t,u,!0)||o&&!u.length&&eg(o,e,c,d,p,n)){r.reRender();return}break;case"dependenciesUpdate":if(s.map(ei).some(function(e){return el(n.relatedFields,e)})){r.reRender();return}break;default:if(f||(!s.length||u.length||o)&&eg(o,e,c,d,p,n)){r.reRender();return}}!0===o&&r.reRender()}),(0,b.Z)((0,f.Z)(r),"validateRules",function(e){var t=r.getNamePath(),n=r.getValue(),a=e||{},o=a.triggerName,i=a.validateOnly,d=Promise.resolve().then((0,l.Z)((0,s.Z)().mark(function a(){var i,p,f,g,m,b,h;return(0,s.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(r.mounted){a.next=2;break}return a.abrupt("return",[]);case 2:if(f=void 0!==(p=(i=r.props).validateFirst)&&p,g=i.messageVariables,m=i.validateDebounce,b=r.getRules(),o&&(b=b.filter(function(e){return e}).filter(function(e){var t=e.validateTrigger;return!t||A(t).includes(o)})),!(m&&o)){a.next=10;break}return a.next=8,new Promise(function(e){setTimeout(e,m)});case 8:if(!(r.validatePromise!==d)){a.next=10;break}return a.abrupt("return",[]);case 10:return(h=function(e,t,n,r,a,o){var i,u,d=e.join("."),p=n.map(function(e,t){var n=e.validator,r=(0,c.Z)((0,c.Z)({},e),{},{ruleIndex:t});return n&&(r.validator=function(e,t,r){var a=!1,o=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=[],a=[];null===(t=e.forEach)||void 0===t||t.call(e,function(e){var t=e.rule.warningOnly,r=e.errors,o=void 0===r?ef:r;t?a.push.apply(a,(0,u.Z)(o)):n.push.apply(n,(0,u.Z)(o))}),r.errors=n,r.warnings=a,r.triggerMetaEvent(),r.reRender()}}),a.abrupt("return",h);case 13:case"end":return a.stop()}},a)})));return void 0!==i&&i||(r.validatePromise=d,r.dirty=!0,r.errors=ef,r.warnings=ef,r.triggerMetaEvent(),r.reRender()),d}),(0,b.Z)((0,f.Z)(r),"isFieldValidating",function(){return!!r.validatePromise}),(0,b.Z)((0,f.Z)(r),"isFieldTouched",function(){return r.touched}),(0,b.Z)((0,f.Z)(r),"isFieldDirty",function(){return!!r.dirty||void 0!==r.props.initialValue||void 0!==(0,r.props.fieldContext.getInternalHooks(v).getInitialValue)(r.getNamePath())}),(0,b.Z)((0,f.Z)(r),"getErrors",function(){return r.errors}),(0,b.Z)((0,f.Z)(r),"getWarnings",function(){return r.warnings}),(0,b.Z)((0,f.Z)(r),"isListField",function(){return r.props.isListField}),(0,b.Z)((0,f.Z)(r),"isList",function(){return r.props.isList}),(0,b.Z)((0,f.Z)(r),"isPreserve",function(){return r.props.preserve}),(0,b.Z)((0,f.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,b.Z)((0,f.Z)(r),"getOnlyChild",function(e){if("function"==typeof e){var t=r.getMeta();return(0,c.Z)((0,c.Z)({},r.getOnlyChild(e(r.getControlled(),t,r.props.fieldContext))),{},{isFunction:!0})}var n=(0,h.Z)(e);return 1===n.length&&a.isValidElement(n[0])?{child:n[0],isFunction:!1}:{child:n,isFunction:!1}}),(0,b.Z)((0,f.Z)(r),"getValue",function(e){var t=r.props.fieldContext.getFieldsValue,n=r.getNamePath();return(0,eo.Z)(e||t(!0),n)}),(0,b.Z)((0,f.Z)(r),"getControlled",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=r.props,n=t.trigger,a=t.validateTrigger,o=t.getValueFromEvent,i=t.normalize,s=t.valuePropName,l=t.getValueProps,u=t.fieldContext,d=void 0!==a?a:u.validateTrigger,p=r.getNamePath(),f=u.getInternalHooks,g=u.getFieldsValue,m=f(v).dispatch,h=r.getValue(),y=l||function(e){return(0,b.Z)({},s,e)},E=e[n],S=(0,c.Z)((0,c.Z)({},e),y(h));return S[n]=function(){r.touched=!0,r.dirty=!0,r.triggerMetaEvent();for(var e,t=arguments.length,n=Array(t),a=0;a=0&&t<=n.length?(p.keys=[].concat((0,u.Z)(p.keys.slice(0,t)),[p.id],(0,u.Z)(p.keys.slice(t))),a([].concat((0,u.Z)(n.slice(0,t)),[e],(0,u.Z)(n.slice(t))))):(p.keys=[].concat((0,u.Z)(p.keys),[p.id]),a([].concat((0,u.Z)(n),[e]))),p.id+=1},remove:function(e){var t=i(),n=new Set(Array.isArray(e)?e:[e]);n.size<=0||(p.keys=p.keys.filter(function(e,t){return!n.has(t)}),a(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||(p.keys=ed(p.keys,e,t),a(ed(n,e,t)))}}},t)})))},ey=n(80406),eE="__@field_split__";function ev(e){return e.map(function(e){return"".concat((0,ea.Z)(e),":").concat(e)}).join(eE)}var eS=function(){function e(){(0,d.Z)(this,e),(0,b.Z)(this,"kvs",new Map)}return(0,p.Z)(e,[{key:"set",value:function(e,t){this.kvs.set(ev(e),t)}},{key:"get",value:function(e){return this.kvs.get(ev(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(ev(e))}},{key:"map",value:function(e){return(0,u.Z)(this.kvs.entries()).map(function(t){var n=(0,ey.Z)(t,2),r=n[0],a=n[1];return e({key:r.split(eE).map(function(e){var t=e.match(/^([^:]*):(.*)$/),n=(0,ey.Z)(t,3),r=n[1],a=n[2];return"number"===r?Number(a):a}),value:a})})}},{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}(),eT=["name"],ew=(0,p.Z)(function e(t){var n=this;(0,d.Z)(this,e),(0,b.Z)(this,"formHooked",!1),(0,b.Z)(this,"forceRootUpdate",void 0),(0,b.Z)(this,"subscribable",!0),(0,b.Z)(this,"store",{}),(0,b.Z)(this,"fieldEntities",[]),(0,b.Z)(this,"initialValues",{}),(0,b.Z)(this,"callbacks",{}),(0,b.Z)(this,"validateMessages",null),(0,b.Z)(this,"preserve",null),(0,b.Z)(this,"lastValidatePromise",null),(0,b.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,b.Z)(this,"getInternalHooks",function(e){return e===v?(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,E.ZP)(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),(0,b.Z)(this,"useSubscribe",function(e){n.subscribable=e}),(0,b.Z)(this,"prevWithoutPreserves",null),(0,b.Z)(this,"setInitialValues",function(e,t){if(n.initialValues=e||{},t){var r,a=(0,Q.T)(e,n.store);null===(r=n.prevWithoutPreserves)||void 0===r||r.map(function(t){var n=t.key;a=(0,Q.Z)(a,n,(0,eo.Z)(e,n))}),n.prevWithoutPreserves=null,n.updateStore(a)}}),(0,b.Z)(this,"destroyForm",function(){var e=new eS;n.getFieldEntities(!0).forEach(function(t){n.isMergedPreserve(t.isPreserve())||e.set(t.getNamePath(),!0)}),n.prevWithoutPreserves=e}),(0,b.Z)(this,"getInitialValue",function(e){var t=(0,eo.Z)(n.initialValues,e);return e.length?(0,Q.T)(t):t}),(0,b.Z)(this,"setCallbacks",function(e){n.callbacks=e}),(0,b.Z)(this,"setValidateMessages",function(e){n.validateMessages=e}),(0,b.Z)(this,"setPreserve",function(e){n.preserve=e}),(0,b.Z)(this,"watchList",[]),(0,b.Z)(this,"registerWatch",function(e){return n.watchList.push(e),function(){n.watchList=n.watchList.filter(function(t){return t!==e})}}),(0,b.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,b.Z)(this,"timeoutId",null),(0,b.Z)(this,"warningUnhooked",function(){}),(0,b.Z)(this,"updateStore",function(e){n.store=e}),(0,b.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,b.Z)(this,"getFieldsMap",function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=new eS;return n.getFieldEntities(e).forEach(function(e){var n=e.getNamePath();t.set(n,e)}),t}),(0,b.Z)(this,"getFieldEntitiesForNamePathList",function(e){if(!e)return n.getFieldEntities(!0);var t=n.getFieldsMap(!0);return e.map(function(e){var n=ei(e);return t.get(n)||{INVALIDATE_NAME_PATH:ei(e)}})}),(0,b.Z)(this,"getFieldsValue",function(e,t){if(n.warningUnhooked(),!0===e||Array.isArray(e)?(r=e,a=t):e&&"object"===(0,ea.Z)(e)&&(o=e.strict,a=e.filter),!0===r&&!a)return n.store;var r,a,o,i=n.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null),s=[];return i.forEach(function(e){var t,n,i,l="INVALIDATE_NAME_PATH"in e?e.INVALIDATE_NAME_PATH:e.getNamePath();if(o){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(a){var c="getMeta"in e?e.getMeta():null;a(c)&&s.push(l)}else s.push(l)}),es(n.store,s.map(ei))}),(0,b.Z)(this,"getFieldValue",function(e){n.warningUnhooked();var t=ei(e);return(0,eo.Z)(n.store,t)}),(0,b.Z)(this,"getFieldsError",function(e){return n.warningUnhooked(),n.getFieldEntitiesForNamePathList(e).map(function(t,n){return!t||"INVALIDATE_NAME_PATH"in t?{name:ei(e[n]),errors:[],warnings:[]}:{name:t.getNamePath(),errors:t.getErrors(),warnings:t.getWarnings()}})}),(0,b.Z)(this,"getFieldError",function(e){n.warningUnhooked();var t=ei(e);return n.getFieldsError([t])[0].errors}),(0,b.Z)(this,"getFieldWarning",function(e){n.warningUnhooked();var t=ei(e);return n.getFieldsError([t])[0].warnings}),(0,b.Z)(this,"isFieldsTouched",function(){n.warningUnhooked();for(var e,t=arguments.length,r=Array(t),a=0;a0&&void 0!==arguments[0]?arguments[0]:{},r=new eS,a=n.getFieldEntities(!0);a.forEach(function(e){var t=e.props.initialValue,n=e.getNamePath();if(void 0!==t){var a=r.get(n)||new Set;a.add({entity:e,value:t}),r.set(n,a)}}),t.entities?e=t.entities:t.namePathList?(e=[],t.namePathList.forEach(function(t){var n,a=r.get(t);a&&(n=e).push.apply(n,(0,u.Z)((0,u.Z)(a).map(function(e){return e.entity})))})):e=a,function(e){e.forEach(function(e){if(void 0!==e.props.initialValue){var a=e.getNamePath();if(void 0!==n.getInitialValue(a))(0,E.ZP)(!1,"Form already set 'initialValues' with path '".concat(a.join("."),"'. Field can not overwrite it."));else{var o=r.get(a);if(o&&o.size>1)(0,E.ZP)(!1,"Multiple Field with path '".concat(a.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(o){var i=n.getFieldValue(a);e.isListField()||t.skipExist&&void 0!==i||n.updateStore((0,Q.Z)(n.store,a,(0,u.Z)(o)[0].value))}}}})}(e)}),(0,b.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(ei);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,b.Z)(this,"setFields",function(e){n.warningUnhooked();var t=n.store,r=[];e.forEach(function(e){var a=e.name,o=(0,i.Z)(e,eT),s=ei(a);r.push(s),"value"in o&&n.updateStore((0,Q.Z)(n.store,s,o.value)),n.notifyObservers(t,[s],{type:"setField",data:e})}),n.notifyWatch(r)}),(0,b.Z)(this,"getFields",function(){return n.getFieldEntities(!0).map(function(e){var t=e.getNamePath(),r=e.getMeta(),a=(0,c.Z)((0,c.Z)({},r),{},{name:t,value:n.getFieldValue(t)});return Object.defineProperty(a,"originRCField",{value:!0}),a})}),(0,b.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,b.Z)(this,"isMergedPreserve",function(e){var t=void 0!==e?e:n.preserve;return null==t||t}),(0,b.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,a){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(t){return t!==e}),!n.isMergedPreserve(a)&&(!r||o.length>1)){var i=r?void 0:n.getInitialValue(t);if(t.length&&n.getFieldValue(t)!==i&&n.fieldEntities.every(function(e){return!ec(e.getNamePath(),t)})){var s=n.store;n.updateStore((0,Q.Z)(s,t,i,!0)),n.notifyObservers(s,[t],{type:"remove"}),n.triggerDependenciesUpdate(s,t)}}n.notifyWatch([t])}}),(0,b.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 a=e.namePath,o=e.triggerName;n.validateFields([a],{triggerName:o})}}),(0,b.Z)(this,"notifyObservers",function(e,t,r){if(n.subscribable){var a=(0,c.Z)((0,c.Z)({},r),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(n){(0,n.onStoreChange)(e,t,a)})}else n.forceRootUpdate()}),(0,b.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,b.Z)(this,"updateValue",function(e,t){var r=ei(e),a=n.store;n.updateStore((0,Q.Z)(n.store,r,t)),n.notifyObservers(a,[r],{type:"valueUpdate",source:"internal"}),n.notifyWatch([r]);var o=n.triggerDependenciesUpdate(a,r),i=n.callbacks.onValuesChange;i&&i(es(n.store,[r]),n.getFieldsValue()),n.triggerOnFieldsChange([r].concat((0,u.Z)(o)))}),(0,b.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,b.Z)(this,"setFieldValue",function(e,t){n.setFields([{name:e,value:t}])}),(0,b.Z)(this,"getDependencyChildrenFields",function(e){var t=new Set,r=[],a=new eS;return n.getFieldEntities().forEach(function(e){(e.props.dependencies||[]).forEach(function(t){var n=ei(t);a.update(n,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Set;return t.add(e),t})})}),function e(n){(a.get(n)||new Set).forEach(function(n){if(!t.has(n)){t.add(n);var a=n.getNamePath();n.isFieldDirty()&&a.length&&(r.push(a),e(a))}})}(e),r}),(0,b.Z)(this,"triggerOnFieldsChange",function(e,t){var r=n.callbacks.onFieldsChange;if(r){var a=n.getFields();if(t){var o=new eS;t.forEach(function(e){var t=e.name,n=e.errors;o.set(t,n)}),a.forEach(function(e){e.errors=o.get(e.name)||e.errors})}var i=a.filter(function(t){return el(e,t.name)});i.length&&r(i,a)}}),(0,b.Z)(this,"validateFields",function(e,t){n.warningUnhooked(),Array.isArray(e)||"string"==typeof e||"string"==typeof t?(i=e,s=t):s=e;var r,a,o,i,s,l=!!i,d=l?i.map(ei):[],p=[],f=String(Date.now()),g=new Set,m=s||{},b=m.recursive,h=m.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(g.add(t.join(f)),!l||el(d,t,b)){var r=e.validateRules((0,c.Z)({validateMessages:(0,c.Z)((0,c.Z)({},X),n.validateMessages)},s));p.push(r.then(function(){return{name:t,errors:[],warnings:[]}}).catch(function(e){var n,r=[],a=[];return(null===(n=e.forEach)||void 0===n||n.call(e,function(e){var t=e.rule.warningOnly,n=e.errors;t?a.push.apply(a,(0,u.Z)(n)):r.push.apply(r,(0,u.Z)(n))}),r.length)?Promise.reject({name:t,errors:r,warnings:a}):{name:t,errors:r,warnings:a}}))}}});var y=(r=!1,a=p.length,o=[],p.length?new Promise(function(e,t){p.forEach(function(n,i){n.catch(function(e){return r=!0,e}).then(function(n){a-=1,o[i]=n,a>0||(r&&t(o),e(o))})})}):Promise.resolve([]));n.lastValidatePromise=y,y.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 E=y.then(function(){return n.lastValidatePromise===y?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!==y})});E.catch(function(e){return e});var v=d.filter(function(e){return g.has(e.join(f))});return n.triggerOnFieldsChange(v),E}),(0,b.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}),eA=function(e){var t=a.useRef(),n=a.useState({}),r=(0,ey.Z)(n,2)[1];if(!t.current){if(e)t.current=e;else{var o=new ew(function(){r({})});t.current=o.getForm()}}return[t.current]},ek=a.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),eR=function(e){var t=e.validateMessages,n=e.onFormChange,r=e.onFormFinish,o=e.children,i=a.useContext(ek),s=a.useRef({});return a.createElement(ek.Provider,{value:(0,c.Z)((0,c.Z)({},i),{},{validateMessages:(0,c.Z)((0,c.Z)({},i.validateMessages),t),triggerFormChange:function(e,t){n&&n(e,{changedFields:t,forms:s.current}),i.triggerFormChange(e,t)},triggerFormFinish:function(e,t){r&&r(e,{values:t,forms:s.current}),i.triggerFormFinish(e,t)},registerForm:function(e,t){e&&(s.current=(0,c.Z)((0,c.Z)({},s.current),{},(0,b.Z)({},e,t))),i.registerForm(e,t)},unregisterForm:function(e){var t=(0,c.Z)({},s.current);delete t[e],s.current=t,i.unregisterForm(e)}})},o)},ex=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"];function eC(e){try{return JSON.stringify(e)}catch(e){return Math.random()}}var eN=function(){},eI=function(){for(var e=arguments.length,t=Array(e),n=0;n1?t-1:0),a=1;a0&&(clearTimeout(em.current),em.current=setTimeout(function(){ey({deadline:!0})},A))),eR===D&&eh(),!0},o=(0,R.Z)(_),s=(i=(0,u.Z)(o,2))[0],d=i[1],p=function(){var e=b.useRef(null);function t(){Y.Z.cancel(e.current)}return b.useEffect(function(){return function(){t()}},[]),[function n(r){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;t();var o=(0,Y.Z)(function(){a<=1?r({isCanceled:function(){return o!==e.current}}):n(r,a-1)});e.current=o},t]}(),g=(f=(0,u.Z)(p,2))[0],m=f[1],h=e?K:X,q(function(){if(s!==_&&"end"!==s){var e=h.indexOf(s),t=h[e+1],n=a(s);!1===n?d(t,!0):t&&g(function(e){function r(){e.isCanceled()||d(t,!0)}!0===n?r():Promise.resolve(n).then(r)})}},[el,s]),b.useEffect(function(){return function(){m()}},[]),[function(){d(O,!0)},s]),eA=(0,u.Z)(ew,2),ek=eA[0],eR=eA[1],ex=Q(eR);eb.current=ex,q(function(){eo(t);var n,r=eg.current;eg.current=!0,!r&&t&&S&&(n=C),r&&t&&E&&(n=N),(r&&!t&&w||!r&&k&&!t&&w)&&(n=I);var a=eS(n);n&&(e||a[O])?(ec(n),ek()):ec(x)},[t]),(0,b.useEffect)(function(){(el!==C||S)&&(el!==N||E)&&(el!==I||w)||ec(x)},[S,E,w]),(0,b.useEffect)(function(){return function(){eg.current=!1,clearTimeout(em.current)}},[]);var eC=b.useRef(!1);(0,b.useEffect)(function(){ea&&(eC.current=!0),void 0!==ea&&el===x&&((eC.current||ea)&&(null==et||et(ea)),eC.current=!0)},[ea,el]);var eN=ep;return eT[O]&&eR===L&&(eN=(0,c.Z)({transition:"none"},eN)),[el,eR,eN,null!=ea?ea:t]}(S,r,function(){try{return T.current instanceof HTMLElement?T.current:(0,g.Z)(w.current)}catch(e){return null}},e),M=(0,u.Z)(A,4),F=M[0],U=M[1],B=M[2],G=M[3],Z=b.useRef(G);G&&(Z.current=!0);var j=b.useCallback(function(e){T.current=e,(0,m.mH)(t,e)},[t]),$=(0,c.Z)((0,c.Z)({},y),{},{visible:r});if(d){if(F===x)z=G?d((0,c.Z)({},$),j):!o&&Z.current&&h?d((0,c.Z)((0,c.Z)({},$),{},{className:h}),j):!s&&(o||h)?null:d((0,c.Z)((0,c.Z)({},$),{},{style:{display:"none"}}),j);else{U===O?ee="prepare":Q(U)?ee="active":U===L&&(ee="start");var z,J,ee,et=W(p,"".concat(F,"-").concat(ee));z=d((0,c.Z)((0,c.Z)({},$),{},{className:f()(W(p,F),(J={},(0,l.Z)(J,et,et&&ee),(0,l.Z)(J,p,"string"==typeof p),J)),style:B}),j)}}else z=null;return b.isValidElement(z)&&(0,m.Yr)(z)&&!z.ref&&(z=b.cloneElement(z,{ref:j})),b.createElement(k,{ref:w},z)})).displayName="CSSMotion",s),ee=n(14749),et=n(34951),en="keep",er="remove",ea="removed";function eo(e){var t;return t=e&&"object"===(0,d.Z)(e)&&"key"in e?e:{key:e},(0,c.Z)((0,c.Z)({},t),{},{key:String(t.key)})}function ei(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(eo)}var es=["component","children","onVisibleChanged","onAllRemoved"],el=["status"],ec=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"],eu=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:J,n=function(e){(0,w.Z)(r,e);var n=(0,A.Z)(r);function r(){var e;(0,S.Z)(this,r);for(var t=arguments.length,a=Array(t),o=0;o0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,a=t.length,o=ei(e),i=ei(t);o.forEach(function(e){for(var t=!1,o=r;o1}).forEach(function(e){(n=n.filter(function(t){var n=t.key,r=t.status;return n!==e||r!==er})).forEach(function(t){t.key===e&&(t.status=en)})}),n})(r,ei(n)).filter(function(e){var t=r.find(function(t){var n=t.key;return e.key===n});return!t||t.status!==ea||e.status!==er})}}}]),r}(b.Component);return(0,l.Z)(n,"defaultProps",{component:"div"}),n}(z),ed=J},46505:function(e,t,n){n.d(t,{Z:function(){return G}});var r=n(14749),a=n(64090),o=n(33054);n(53850);var i=n(5239),s=n(6976),l=n(97472),c=n(74084),u=a.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(){p&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),b?(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(){p&&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;m.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}(),y=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),C="undefined"!=typeof WeakMap?new WeakMap:new d,N=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 x(t,h.getInstance(),this);C.set(this,n)};["observe","unobserve","disconnect"].forEach(function(e){N.prototype[e]=function(){var t;return(t=C.get(this))[e].apply(t,arguments)}});var I=void 0!==f.ResizeObserver?f.ResizeObserver:N,_=new Map,O=new I(function(e){e.forEach(function(e){var t,n=e.target;null===(t=_.get(n))||void 0===t||t.forEach(function(e){return e(n)})})}),L=n(47365),P=n(65127),D=n(96171),M=n(85430),F=function(e){(0,D.Z)(n,e);var t=(0,M.Z)(n);function n(){return(0,L.Z)(this,n),t.apply(this,arguments)}return(0,P.Z)(n,[{key:"render",value:function(){return this.props.children}}]),n}(a.Component),U=a.forwardRef(function(e,t){var n=e.children,r=e.disabled,o=a.useRef(null),d=a.useRef(null),p=a.useContext(u),f="function"==typeof n,g=f?n(o):n,m=a.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),b=!f&&a.isValidElement(g)&&(0,c.Yr)(g),h=b?g.ref:null,y=(0,c.x1)(h,o),E=function(){var e;return(0,l.Z)(o.current)||(o.current&&"object"===(0,s.Z)(o.current)?(0,l.Z)(null===(e=o.current)||void 0===e?void 0:e.nativeElement):null)||(0,l.Z)(d.current)};a.useImperativeHandle(t,function(){return E()});var v=a.useRef(e);v.current=e;var S=a.useCallback(function(e){var t=v.current,n=t.onResize,r=t.data,a=e.getBoundingClientRect(),o=a.width,s=a.height,l=e.offsetWidth,c=e.offsetHeight,u=Math.floor(o),d=Math.floor(s);if(m.current.width!==u||m.current.height!==d||m.current.offsetWidth!==l||m.current.offsetHeight!==c){var f={width:u,height:d,offsetWidth:l,offsetHeight:c};m.current=f;var g=(0,i.Z)((0,i.Z)({},f),{},{offsetWidth:l===Math.round(o)?o:l,offsetHeight:c===Math.round(s)?s:c});null==p||p(g,e,r),n&&Promise.resolve().then(function(){n(g,e)})}},[]);return a.useEffect(function(){var e=E();return e&&!r&&(_.has(e)||(_.set(e,new Set),O.observe(e)),_.get(e).add(S)),function(){_.has(e)&&(_.get(e).delete(S),_.get(e).size||(O.unobserve(e),_.delete(e)))}},[o.current,r]),a.createElement(F,{ref:d},b?a.cloneElement(g,{ref:y}):g)}),B=a.forwardRef(function(e,t){var n=e.children;return("function"==typeof n?[n]:(0,o.Z)(n)).map(function(n,o){var i=(null==n?void 0:n.key)||"".concat("rc-observer-key","-").concat(o);return a.createElement(U,(0,r.Z)({},e,{key:i,ref:0===o?t:void 0}),n)})});B.Collection=function(e){var t=e.children,n=e.onBatchResize,r=a.useRef(0),o=a.useRef([]),i=a.useContext(u),s=a.useCallback(function(e,t,a){r.current+=1;var s=r.current;o.current.push({size:e,element:t,data:a}),Promise.resolve().then(function(){s===r.current&&(null==n||n(o.current),o.current=[])}),null==i||i(e,t,a)},[n,i]);return a.createElement(u.Provider,{value:s},t)};var G=B},33054:function(e,t,n){n.d(t,{Z:function(){return function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=[];return r.Children.forEach(t,function(t){(null!=t||n.keepEmpty)&&(Array.isArray(t)?o=o.concat(e(t)):(0,a.isFragment)(t)&&t.props?o=o.concat(e(t.props.children,n)):o.push(t))}),o}}});var r=n(64090),a=n(24185)},22127:function(e,t,n){n.d(t,{Z:function(){return r}});function r(){return!!window.document&&!!window.document.createElement}},31506:function(e,t,n){n.d(t,{Z:function(){return r}});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}},24050:function(e,t,n){n.d(t,{hq:function(){return g},jL:function(){return f}});var r=n(22127),a=n(31506),o="data-rc-order",i="data-rc-priority",s=new Map;function l(){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 c(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function u(e){return Array.from((s.get(e)||e).children).filter(function(e){return"STYLE"===e.tagName})}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(0,r.Z)())return null;var n=t.csp,a=t.prepend,s=t.priority,l=void 0===s?0:s,d="queue"===a?"prependQueue":a?"prepend":"append",p="prependQueue"===d,f=document.createElement("style");f.setAttribute(o,d),p&&l&&f.setAttribute(i,"".concat(l)),null!=n&&n.nonce&&(f.nonce=null==n?void 0:n.nonce),f.innerHTML=e;var g=c(t),m=g.firstChild;if(a){if(p){var b=u(g).filter(function(e){return!!["prepend","prependQueue"].includes(e.getAttribute(o))&&l>=Number(e.getAttribute(i)||0)});if(b.length)return g.insertBefore(f,b[b.length-1].nextSibling),f}g.insertBefore(f,m)}else g.appendChild(f);return f}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return u(c(t)).find(function(n){return n.getAttribute(l(t))===e})}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=p(e,t);n&&c(t).removeChild(n)}function g(e,t){var n,r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){var n=s.get(e);if(!n||!(0,a.Z)(document,n)){var r=d("",t),o=r.parentNode;s.set(e,o),e.removeChild(r)}}(c(i),i);var u=p(t,i);if(u)return null!==(n=i.csp)&&void 0!==n&&n.nonce&&u.nonce!==(null===(r=i.csp)||void 0===r?void 0:r.nonce)&&(u.nonce=null===(o=i.csp)||void 0===o?void 0:o.nonce),u.innerHTML!==e&&(u.innerHTML=e),u;var f=d(e,i);return f.setAttribute(l(i),t),f}},97472:function(e,t,n){n.d(t,{S:function(){return o},Z:function(){return i}});var r=n(64090),a=n(89542);function o(e){return e instanceof HTMLElement||e instanceof SVGElement}function i(e){return o(e)?e:e instanceof r.Component?a.findDOMNode(e):null}},73193:function(e,t,n){n.d(t,{Z:function(){return r}});function r(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 a=e.getBoundingClientRect(),o=a.width,i=a.height;if(o||i)return!0}}return!1}},74687:function(e,t,n){function r(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}function a(e){return r(e) instanceof ShadowRoot?r(e):null}n.d(t,{A:function(){return a}})},4295:function(e,t){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},37274:function(e,t,n){n.d(t,{s:function(){return b},v:function(){return y}});var r,a,o=n(86926),i=n(74902),s=n(6976),l=n(5239),c=n(89542),u=(0,l.Z)({},r||(r=n.t(c,2))),d=u.version,p=u.render,f=u.unmountComponentAtNode;try{Number((d||"").split(".")[0])>=18&&(a=u.createRoot)}catch(e){}function g(e){var t=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&"object"===(0,s.Z)(t)&&(t.usingClientEntryPoint=e)}var m="__rc_react_root__";function b(e,t){if(a){var n;g(!0),n=t[m]||a(t),g(!1),n.render(e),t[m]=n;return}p(e,t)}function h(){return(h=(0,i.Z)((0,o.Z)().mark(function e(t){return(0,o.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 y(e){return E.apply(this,arguments)}function E(){return(E=(0,i.Z)((0,o.Z)().mark(function e(t){return(0,o.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(void 0!==a)){e.next=2;break}return e.abrupt("return",function(e){return h.apply(this,arguments)}(t));case 2:f(t);case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}},54811:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(64090);function a(e){var t=r.useRef();return t.current=e,r.useCallback(function(){for(var e,n=arguments.length,r=Array(n),a=0;a2&&void 0!==arguments[2]&&arguments[2],o=new Set;return function e(t,i){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,l=o.has(t);if((0,a.ZP)(!l,"Warning: There may be circular references"),l)return!1;if(t===i)return!0;if(n&&s>1)return!1;o.add(t);var c=s+1;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(var u=0;u